38template <
typename T,
typename... Args>
40 T* raw_ptr =
new (std::nothrow) T(std::forward<Args>(args)...);
44 return std::unique_ptr<T>(raw_ptr);
68 T* raw_ptr =
new (std::nothrow) T[size];
72 return std::unique_ptr<T[]>(raw_ptr);
std::unique_ptr< T > make_unique_nothrow(Args &&... args)
Creates a unique_ptr using nothrow new for exception-free design.
Definition memory_utils.h:39
std::unique_ptr< T[]> make_unique_array_nothrow(size_t size)
Creates a unique_ptr for arrays using nothrow new.
Definition memory_utils.h:67