From f499779ffc8e742533018def3d88200361e8b0a7 Mon Sep 17 00:00:00 2001 From: Danny Robson Date: Wed, 4 Jan 2012 17:04:17 +1100 Subject: [PATCH] Use forwarding for make_unique arguments --- types.hpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/types.hpp b/types.hpp index 32de0fcf..66ad9426 100644 --- a/types.hpp +++ b/types.hpp @@ -142,11 +142,10 @@ template size_t elems(T (&)[N]) { return N; } - -template -std::unique_ptr -make_unique (const Args &...args) - { return std::unique_ptr (new T (args...)); } +template +std::unique_ptr make_unique(Args&&... args) { + return std::unique_ptr (new T(std::forward(args)...)); +} struct fourcc {