18 #ifndef __UT_UNIQUEPTR_H_INCLUDED__
19 #define __UT_UNIQUEPTR_H_INCLUDED__
23 #include <type_traits>
37 class Deleter = std::default_delete<T>
47 std::enable_if_t<!std::is_array_v<T>,
int> = 0
58 std::enable_if_t<std::is_array_v<T> && std::extent_v<T> == 0,
int> = 0
63 using ElemT = std::remove_extent_t<T>;
71 std::enable_if_t<std::extent_v<T> != 0,
int> = 0
78 std::enable_if_t<!std::is_array_v<T>,
int> = 0
89 std::enable_if_t<std::is_array_v<T> && std::extent_v<T> == 0,
int> = 0
94 using ElemT = std::remove_extent_t<T>;
102 std::enable_if_t<std::extent_v<T> != 0,
int> = 0
109 template <
typename T>
110 struct DefaultClearer;
112 template <
typename T>
121 static const bool clearNeedsDestruction =
false;
125 #endif // __UT_UNIQUEPTR_H_INCLUDED__
std::unique_ptr< T, Deleter > UT_UniquePtr
A smart pointer for unique ownership of dynamically allocated objects.
static void clear(UT_UniquePtr< T > &v)
static void clearConstruct(UT_UniquePtr< T > *p)
UT_UniquePtr< T > UTmakeUnique(REST &&...args)
**If you just want to fire and args
static bool isClear(const UT_UniquePtr< T > &v)
UT_UniquePtr< T > UTmakeUniqueForOverwrite()
Construct a default initialized T in a UT_UniquePtr.