Add a make_unique implementation

This commit is contained in:
Danny Robson 2011-07-16 14:47:34 +10:00
parent ce747924ab
commit 64448e7e5e

View File

@ -6,6 +6,7 @@
#include <cstdint>
#include <string>
#include <limits>
#include <memory>
template <int BITS>
struct bits_type;
@ -130,4 +131,11 @@ T hton (T);
template <typename T>
T ntoh (T);
template <typename T, typename ...Args>
std::unique_ptr<T>
make_unique (const Args &...args)
{ return std::unique_ptr<T> (new T (args...)); }
#endif // __TYPES_HPP