diff options
| author | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2016-01-30 19:13:41 +0900 |
|---|---|---|
| committer | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2016-01-30 19:13:41 +0900 |
| commit | e4d4eabd85db766a8c89d424138456e9c709c800 (patch) | |
| tree | 8af6d8be3c21ee0ef661ceed4c07e702509a4cdf /src/a2functional.h | |
| parent | 83aae472faed84c97dc79a556730fd376d8a442c (diff) | |
Use std::make_unique if C++14 is used
Diffstat (limited to 'src/a2functional.h')
| -rw-r--r-- | src/a2functional.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/a2functional.h b/src/a2functional.h index a99af0dc..c1059fef 100644 --- a/src/a2functional.h +++ b/src/a2functional.h @@ -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) |
