1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
#ifndef MAKE_UNIQUE_HH #define MAKE_UNIQUE_HH #include <memory> namespace std { template<typename T, typename... Args> inline std::unique_ptr<T> make_unique(Args&&... args) { return std::unique_ptr<T>(new T(std::forward<Args>(args)...)); } } // namespace std #endif // MAKE_UNIQUE_HH