diff --git a/src/google/protobuf/map.h b/src/google/protobuf/map.h index f246dd10af..543b45d793 100644 --- a/src/google/protobuf/map.h +++ b/src/google/protobuf/map.h @@ -167,11 +167,23 @@ class Map { } } +#if __cplusplus >= 201103L + template + void construct(NodeType* p, Args&&... args) { + new (p) NodeType(std::forward(args)...); + } + + template + 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 struct rebind {