Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYuri Gorshenin <ygorshenin@chromium.org>2015-03-13 17:55:10 +0300
committerAlex Zolotarev <alex@maps.me>2015-09-23 02:41:24 +0300
commit2b0f4125289657beaa71b80f5897052d36521104 (patch)
tree31a656501d5afcc9d296c878ebed88aa9b71ce1f /std/unique_ptr.hpp
parentf7203eb9b75a01270d63e74e8eccebdf531c5742 (diff)
[thread] Refactored lifetime management of multithreaded tasks.
Diffstat (limited to 'std/unique_ptr.hpp')
-rw-r--r--std/unique_ptr.hpp8
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