Index: src/zone/zone-allocator.h |
diff --git a/src/zone/zone-allocator.h b/src/zone/zone-allocator.h |
index 1e2862a2c1144b018884d6c55643f301c6bff3be..dfd1f95ae55e6301f00952cf7e90ca904d652b80 100644 |
--- a/src/zone/zone-allocator.h |
+++ b/src/zone/zone-allocator.h |
@@ -49,10 +49,15 @@ class zone_allocator { |
size_type max_size() const throw() { |
return std::numeric_limits<int>::max() / sizeof(value_type); |
} |
- void construct(pointer p, const T& val) { |
- new (static_cast<void*>(p)) T(val); |
+ template <typename U, typename... Args> |
+ void construct(U* p, Args&&... args) { |
+ void* v_p = const_cast<void*>(static_cast<const void*>(p)); |
+ new (v_p) U(std::forward<Args>(args)...); |
+ } |
+ template <typename U> |
+ void destroy(U* p) { |
+ p->~U(); |
} |
- void destroy(pointer p) { p->~T(); } |
bool operator==(zone_allocator const& other) const { |
return zone_ == other.zone_; |