From e4d4eabd85db766a8c89d424138456e9c709c800 Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Sat, 30 Jan 2016 19:13:41 +0900 Subject: [PATCH] Use std::make_unique if C++14 is used --- src/a2functional.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/a2functional.h b/src/a2functional.h index a99af0dc7..c1059fef3 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 std::enable_if::value, std::unique_ptr>::type make_unique(U&&... u) @@ -163,6 +166,7 @@ make_unique(size_t size) { return std::unique_ptr(new typename std::remove_extent::type[size]()); } +#endif // __cplusplus <= 201103L // User-defined literals for K, M, and G (powers of 1024)