diff options
Diffstat (limited to 'src/make_unique.hh')
| -rw-r--r-- | src/make_unique.hh | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/make_unique.hh b/src/make_unique.hh new file mode 100644 index 0000000..c5a1bbc --- /dev/null +++ b/src/make_unique.hh @@ -0,0 +1,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 |
