5 #if defined(_MSC_VER) && __cplusplus == 201103L 6 # define MAKE_UNIQUE_DEFINED 1 9 #ifdef __cpp_lib_make_unique 10 # define MAKE_UNIQUE_DEFINED 1 13 #ifndef MAKE_UNIQUE_DEFINED 19 #include <type_traits> 32 template<
class _Ty,
size_t N>
struct _Unique_if<_Ty[N]> {
36 template<
class _Ty,
class... Args>
39 return unique_ptr<_Ty>(
new _Ty(std::forward<Args>(args)...));
45 typedef typename remove_extent<_Ty>::type U;
46 return unique_ptr<_Ty>(
new U[n]());
52 #endif // !COMPILER_SUPPORTS_MAKE_UNIQUE unique_ptr< _Ty[]> _Unknown_bound
unique_ptr< _Ty > _Single_object
_Unique_if< _Ty >::_Single_object make_unique(Args &&...args)