From 05d75ed21826ec699083836bc32bd6e14ae1ac87 Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Thu, 4 Jul 2013 03:02:33 +0900 Subject: [PATCH] Fix array version make_unique is invoked for 1 size_t arg accidentally --- src/a2functional.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/a2functional.h b/src/a2functional.h index 11391e51..28a49001 100644 --- a/src/a2functional.h +++ b/src/a2functional.h @@ -181,13 +181,15 @@ struct RefLess { }; template -std::unique_ptr make_unique(U&&... u) +typename std::enable_if::value, std::unique_ptr>::type +make_unique(U&&... u) { return std::unique_ptr(new T(std::forward(u)...)); } template -std::unique_ptr make_unique(size_t size) +typename std::enable_if::value, std::unique_ptr>::type +make_unique(size_t size) { return std::unique_ptr(new typename std::remove_extent::type[size]()); }