diff options
author | Yuri Gorshenin <ygorshenin@chromium.org> | 2015-03-13 17:55:10 +0300 |
---|---|---|
committer | Alex Zolotarev <alex@maps.me> | 2015-09-23 02:41:24 +0300 |
commit | 2b0f4125289657beaa71b80f5897052d36521104 (patch) | |
tree | 31a656501d5afcc9d296c878ebed88aa9b71ce1f /std | |
parent | f7203eb9b75a01270d63e74e8eccebdf531c5742 (diff) |
[thread] Refactored lifetime management of multithreaded tasks.
Diffstat (limited to 'std')
-rw-r--r-- | std/unique_ptr.hpp | 8 |
1 files changed, 8 insertions, 0 deletions
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 <memory> using std::unique_ptr; +/// @todo(y): replace this hand-written helper function by +/// std::make_unique when it will be available. +template <typename T, typename... Args> +unique_ptr<T> make_unique(Args &&... args) +{ + return unique_ptr<T>(new T(std::forward<Args>(args)...)); +} + #ifdef DEBUG_NEW #define new DEBUG_NEW #endif |