18 #ifndef __UT_SHAREDPTR_H_INCLUDED__
19 #define __UT_SHAREDPTR_H_INCLUDED__
22 #include <type_traits>
41 #define UTallocateShared std::allocate_shared
43 #define UTstatic_pointer_cast std::static_pointer_cast
44 #define UTdynamic_pointer_cast std::dynamic_pointer_cast
45 #define UTconst_pointer_cast std::const_pointer_cast
46 #define UTreinterpret_pointer_cast std::reinterpret_pointer_cast
72 template<
class T, std::
size_t N>
77 template <
typename T,
typename... Args>
84 return std::make_shared<T>(std::forward<Args>(
args)...);
99 return std::make_shared<T>(len);
101 static_assert(
sizeof(std::remove_extent_t<T>) == 0,
102 "Not allowed until C++20, use UTmakeSharedArrayPtr<T>() instead");
108 template <
typename T>
118 return std::make_shared<T>();
120 static_assert(
sizeof(std::remove_extent_t<T>) == 0,
121 "Not allowed until C++20, use UTmakeSharedArrayPtr<T>() instead");
129 template <
typename T>
130 struct DefaultClearer;
132 template <
typename T>
141 static const bool clearNeedsDestruction =
false;
145 #endif // __UT_SHAREDPTR_H_INCLUDED__
UT_SharedPtr< T > UTmakeSharedArrayPtr(size_t len)
typename std::enable_if< B, T >::type enable_if_t
Define Imath::enable_if_t to be std for C++14, equivalent for C++11.
static void clearConstruct(UT_SharedPtr< T > *p)
GLsizei const GLfloat * value
std::enable_shared_from_this< T > UTenable_shared_from_this
static bool isClear(const UT_SharedPtr< T > &v)
std::shared_ptr< T > UT_SharedPtr
Wrapper around std::shared_ptr.
std::enable_if_t< !std::is_array< T >::value, UT_SharedPtr< T >> UTmakeShared(Args &&...args)
Create UT_SharedPtr<T> to T constructed with args.
static void clear(UT_SharedPtr< T > &v)
GA_API const UT_StringHolder N
**If you just want to fire and args
std::weak_ptr< T > UT_WeakPtr