Add a make_unique implementation
This commit is contained in:
parent
ce747924ab
commit
64448e7e5e
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user