From 2b0f4125289657beaa71b80f5897052d36521104 Mon Sep 17 00:00:00 2001 From: Yuri Gorshenin Date: Fri, 13 Mar 2015 17:55:10 +0300 Subject: [thread] Refactored lifetime management of multithreaded tasks. --- std/unique_ptr.hpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'std') diff --git a/std/unique_ptr.hpp b/std/unique_ptr.hpp index e0f9f2e16b..0d647a4df5 100644 --- a/std/unique_ptr.hpp +++ b/std/unique_ptr.hpp @@ -8,6 +8,14 @@ #include using std::unique_ptr; +/// @todo(y): replace this hand-written helper function by +/// std::make_unique when it will be available. +template +unique_ptr make_unique(Args &&... args) +{ + return unique_ptr(new T(std::forward(args)...)); +} + #ifdef DEBUG_NEW #define new DEBUG_NEW #endif -- cgit v1.2.3