Fix compatibility with gcc 4.8

This commit is contained in:
Maxime Coste 2015-01-13 22:56:51 +00:00
parent 118a6e1a7c
commit 1e3e0b01af

View File

@ -3,6 +3,7 @@
#include <cstdlib> #include <cstdlib>
#include <cstddef> #include <cstddef>
#include <utility>
#include "assert.hh" #include "assert.hh"
@ -81,6 +82,15 @@ struct Allocator
domain_allocated_bytes[(int)domain] -= size; domain_allocated_bytes[(int)domain] -= size;
free(ptr); free(ptr);
} }
template<class U, class... Args>
void construct(U* p, Args&&... args)
{
new (p) U(std::forward<Args>(args)...);
}
template<class U>
void destroy(U* p) { p->~U(); }
}; };
template<typename T1, MemoryDomain d1, typename T2, MemoryDomain d2> template<typename T1, MemoryDomain d1, typename T2, MemoryDomain d2>