diff --git a/src/make_unique.h b/src/make_unique.h new file mode 100644 index 0000000000000000000000000000000000000000..f336eb4f7ff52eae0e7014505180bb060f48ee70 --- /dev/null +++ b/src/make_unique.h @@ -0,0 +1,24 @@ +/** + * \file make_unique.h + * + * Created on: Oct 11, 2017 + * \author: Jeremie Deray + */ + +#ifndef _WOLF_MAKE_UNIQUE_H_ +#define _WOLF_MAKE_UNIQUE_H_ + +#include <memory> + +namespace wolf { + +/// @note this appears only in cpp14 +template <typename T, typename... Args> +std::unique_ptr<T> make_unique(Args&&... args) +{ + return std::unique_ptr<T>(new T(std::forward<Args>(args)...)); +} + +} + +#endif /* _WOLF_MAKE_UNIQUE_H_ */