Commit 850fe8bf authored by Paul Yang's avatar Paul Yang

Merge pull request #430 from xfxyjwf/std11_fix

Make MapAllocator work with C++11.
parents 1b540d57 bdd105d9
......@@ -167,11 +167,23 @@ class Map {
}
}
#if __cplusplus >= 201103L
template<class NodeType, class... Args>
void construct(NodeType* p, Args&&... args) {
new (p) NodeType(std::forward<Args>(args)...);
}
template<class NodeType>
void destroy(NodeType* p) {
if (arena_ == NULL) p->~NodeType();
}
#else
void construct(pointer p, const_reference t) { new (p) value_type(t); }
void destroy(pointer p) {
if (arena_ == NULL) p->~value_type();
}
#endif
template <typename X>
struct rebind {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment