13 template<
typename T,
typename... Args>
35 template<typename U> requires std::is_base_of_v<T, U>
39 template<typename U> requires std::is_base_of_v<T, U>
41 inline auto operator=(std::nullptr_t) noexcept ->
UniquePtr&;
43 bool operator==(std::nullptr_t) const noexcept {
return _ptr ==
nullptr; }
48 inline auto get() const noexcept -> T* {
return _ptr; }
86 ,
_deleter{
reinterpret_cast<void*
>(deleter_fn) }
91 :
_alloc{ std::exchange(other._alloc,
nullptr) }
92 ,
_ptr{ std::exchange(other._ptr,
nullptr) }
93 ,
_deleter{ std::exchange(other._deleter,
nullptr) }
98 template<
typename U>
requires std::is_base_of_v<T, U>
100 :
_alloc{ std::exchange(other._alloc,
nullptr) }
101 ,
_ptr{ std::exchange(other._ptr,
nullptr) }
102 ,
_deleter{ std::exchange(other._deleter,
nullptr) }
113 _alloc = std::exchange(other._alloc,
nullptr);
114 _ptr = std::exchange(other._ptr,
nullptr);
115 _deleter = std::exchange(other._deleter,
nullptr);
121 template<
typename U>
requires std::is_base_of_v<T, U>
126 _alloc = std::exchange(other._alloc,
nullptr);
127 _ptr = std::exchange(other._ptr,
nullptr);
128 _deleter = std::exchange(other._deleter,
nullptr);
173 template<
typename T,
typename... Args>
175 {
new T{ std::forward<Args>(args)... } } -> std::convertible_to<T*>;
178 template<
typename T,
typename... Args>
181 static_assert(std::is_abstract_v<T> ==
false,
"Can't instantiate an abstract type!");
#define ICE_ASSERT_CORE(expression)
Definition assert_core.hxx:43
Definition mem_unique_ptr.hxx:174
Root namespace for all APIs part of the IceShard engine project.
Definition array.hxx:12
constexpr bool is_type_complete
Compile-time check returning true or false depending if a types definition is considered complete.
Definition base.hxx:99
auto alloc(ice::usize size) noexcept -> ice::AllocResult
auto make_unique(ice::Allocator &alloc, Args &&... args) noexcept -> ice::UniquePtr< T >
Definition mem_unique_ptr.hxx:179
void(T *) noexcept UniquePtrCustomDeleter
Definition mem_unique_ptr.hxx:17
ice::AllocatorBase< ice::build::is_debug||ice::build::is_develop > Allocator
Definition mem_types.hxx:25
Definition mem_unique_ptr.hxx:58
ice::UniquePtrCustomDeleter< T > * fn_deleter
Definition mem_unique_ptr.hxx:60
Definition mem_unique_ptr.hxx:25
Allocator * _alloc
Definition mem_unique_ptr.hxx:51
ParamsInternal * _ptr
Definition mem_unique_ptr.hxx:52
auto operator*() const noexcept -> T &
Definition mem_unique_ptr.hxx:46
~UniquePtr() noexcept
Definition mem_unique_ptr.hxx:70
auto get() const noexcept -> T *
Definition mem_unique_ptr.hxx:48
auto operator->() const noexcept -> T *
Definition mem_unique_ptr.hxx:45
void reset() noexcept
Definition mem_unique_ptr.hxx:140
void * _deleter
Definition mem_unique_ptr.hxx:53
auto operator=(UniquePtr &&other) noexcept -> UniquePtr &
Definition mem_unique_ptr.hxx:107
UniquePtr() noexcept
Definition mem_unique_ptr.hxx:64