1 #ifndef UGDK_SYSTEM_COMPATIBILITY_H_
2 #define UGDK_SYSTEM_COMPATIBILITY_H_
9 template <
typename T,
typename... Args>
inline
10 typename std::enable_if<!std::is_array<T>::value, std::unique_ptr<T>>::type
12 return std::unique_ptr<T>(
new T(std::forward<Args>(args)...));
15 template <
typename T>
inline
16 typename std::enable_if<std::is_array<T>::value && std::extent<T>::value == 0, std::unique_ptr<T>>::type
18 using Element =
typename std::remove_extent<T>::type;
19 return std::unique_ptr<T>(
new Element[size]);
22 template <
typename T,
typename... Args>
inline
23 typename std::enable_if<std::extent<T>::value != 0,
void>::type
27 #endif // UGDK_SYSTEM_COMPATIBILITY_H_
Definition: animation.h:11
std::enable_if<!std::is_array< T >::value, std::unique_ptr< T > >::type MakeUnique(Args &&...args)
Definition: compatibility.h:11