From 1e3e0b01afe9b7fd972a102d5685d87d48fdbe5d Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Tue, 13 Jan 2015 22:56:51 +0000 Subject: [PATCH] Fix compatibility with gcc 4.8 --- src/memory.hh | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/memory.hh b/src/memory.hh index a6752c78..6fcd2f59 100644 --- a/src/memory.hh +++ b/src/memory.hh @@ -3,6 +3,7 @@ #include #include +#include #include "assert.hh" @@ -81,6 +82,15 @@ struct Allocator domain_allocated_bytes[(int)domain] -= size; free(ptr); } + + template + void construct(U* p, Args&&... args) + { + new (p) U(std::forward(args)...); + } + + template + void destroy(U* p) { p->~U(); } }; template