diff --git a/include/sled/make_unique.h b/include/sled/make_unique.h new file mode 100644 index 0000000..08944bc --- /dev/null +++ b/include/sled/make_unique.h @@ -0,0 +1,15 @@ +#ifndef SLED_MAKE_UNIQUE_H +#define SLED_MAKE_UNIQUE_H +#pragma once +#include + +namespace sled { +template +inline auto +MakeUnique(Args &&...args) -> std::unique_ptr +{ + return std::move(std::unique_ptr(new T(std::forward(args)...))); +} + +}// namespace sled +#endif// SLED_MAKE_UNIQUE_H diff --git a/include/sled/sled.h b/include/sled/sled.h index 84b836b..5c8df03 100644 --- a/include/sled/sled.h +++ b/include/sled/sled.h @@ -66,6 +66,7 @@ #include "sled/byte_order.h" #include "sled/cleanup.h" #include "sled/make_ref_counted.h" +#include "sled/make_unique.h" #include "sled/operations_chain.h" #include "sled/optional.h" #include "sled/random.h"