mirror of
https://github.com/aria2/aria2.git
synced 2026-04-02 10:55:00 +00:00
Use std::make_unique if C++14 is used
This commit is contained in:
@@ -150,6 +150,9 @@ struct RefLess {
|
||||
}
|
||||
};
|
||||
|
||||
#if __cplusplus > 201103L
|
||||
using std::make_unique;
|
||||
#else // __cplusplus <= 201103L
|
||||
template <typename T, typename... U>
|
||||
typename std::enable_if<!std::is_array<T>::value, std::unique_ptr<T>>::type
|
||||
make_unique(U&&... u)
|
||||
@@ -163,6 +166,7 @@ make_unique(size_t size)
|
||||
{
|
||||
return std::unique_ptr<T>(new typename std::remove_extent<T>::type[size]());
|
||||
}
|
||||
#endif // __cplusplus <= 201103L
|
||||
|
||||
// User-defined literals for K, M, and G (powers of 1024)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user