From 8b5370313dcc00a45ea5c3e8b4c497bc00fd8e13 Mon Sep 17 00:00:00 2001 From: Ben Longbons Date: Tue, 11 Jun 2013 21:55:13 -0700 Subject: Allegedly remove all manual memory management --- src/common/utils2.hpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/common/utils2.hpp') diff --git a/src/common/utils2.hpp b/src/common/utils2.hpp index 5f02beb..2218625 100644 --- a/src/common/utils2.hpp +++ b/src/common/utils2.hpp @@ -214,17 +214,17 @@ struct is_array_of_unknown_bound : std::is_same::type[]> {}; -template -typename std::enable_if::value, std::unique_ptr>::type make_unique(A&&... a) +template, class... A> +typename std::enable_if::value, std::unique_ptr>::type make_unique(A&&... a) { - return std::unique_ptr(new T(a...)); + return std::unique_ptr(new T(a...)); } -template -typename std::enable_if::value, std::unique_ptr>::type make_unique(size_t sz) +template> +typename std::enable_if::value, std::unique_ptr>::type make_unique(size_t sz) { typedef typename std::remove_extent::type E; - return std::unique_ptr(new E[sz]); + return std::unique_ptr(new E[sz]()); } #endif // UTILS2_HPP -- cgit v1.2.3-70-g09d2