From 38140372d8c8dd32267943d5d79b2ce2c0a032fb Mon Sep 17 00:00:00 2001 From: Joel Klinghed Date: Tue, 31 Oct 2017 15:01:57 +0100 Subject: Use std::make_unique --- src/make_unique.hh | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 src/make_unique.hh (limited to 'src/make_unique.hh') 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 + +namespace std { + +template +inline std::unique_ptr make_unique(Args&&... args) { + return std::unique_ptr(new T(std::forward(args)...)); +} + +} // namespace std + +#endif // MAKE_UNIQUE_HH -- cgit v1.3