diff options
author | 2016-05-25 14:52:40 +0200 | |
---|---|---|
committer | 2016-05-25 14:52:40 +0200 | |
commit | f5179f7ec8483f3975cf584dc939c99d8d42954b (patch) | |
tree | 74878eef137b9991e5d3cbc3bbacf1029da65030 /src/lib/netlist/plib/palloc.h | |
parent | cac1c41edfe85ab1350d77346cb490ee4c0c1298 (diff) |
Make netlist compile with c++11, use own implementation of make_unique
to avoid c++14. (nw)
Diffstat (limited to 'src/lib/netlist/plib/palloc.h')
-rw-r--r-- | src/lib/netlist/plib/palloc.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/lib/netlist/plib/palloc.h b/src/lib/netlist/plib/palloc.h index a4e046125d5..bc0b18a2ff8 100644 --- a/src/lib/netlist/plib/palloc.h +++ b/src/lib/netlist/plib/palloc.h @@ -10,6 +10,8 @@ #include <exception> #include <vector> +#include <memory> +#include <utility> #include "pconfig.h" #include "pstring.h" @@ -121,6 +123,11 @@ inline void pfree_array_t(T *p) #endif +template<typename T, typename... Args> +std::unique_ptr<T> pmake_unique(Args&&... args) { + return std::unique_ptr<T>(new T(std::forward<Args>(args)...)); +} + class pmempool { private: |