diff options
Diffstat (limited to 'zen/stl_tools.h')
-rw-r--r-- | zen/stl_tools.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/zen/stl_tools.h b/zen/stl_tools.h index e9fe149a..78d99832 100644 --- a/zen/stl_tools.h +++ b/zen/stl_tools.h @@ -159,6 +159,7 @@ template <class K, class V> class hash_map : public std::unordered_map<K, V> {}; #endif //as long as variadic templates are not available in MSVC +template<class T> inline std::unique_ptr<T> make_unique() { return std::unique_ptr<T>(new T); } template<class T, class Arg1> inline std::unique_ptr<T> make_unique(Arg1&& arg1) { return std::unique_ptr<T>(new T(std::forward<Arg1>(arg1))); } template<class T, class Arg1, class Arg2> inline std::unique_ptr<T> make_unique(Arg1&& arg1, Arg2&& arg2) { return std::unique_ptr<T>(new T(std::forward<Arg1>(arg1), std::forward<Arg2>(arg2))); } template<class T, class Arg1, class Arg2, class Arg3> inline std::unique_ptr<T> make_unique(Arg1&& arg1, Arg2&& arg2, Arg3&& arg3) { return std::unique_ptr<T>(new T(std::forward<Arg1>(arg1), std::forward<Arg2>(arg2), std::forward<Arg3>(arg3))); } |