aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/google/protobuf/map.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/google/protobuf/map.h')
-rw-r--r--src/google/protobuf/map.h11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/google/protobuf/map.h b/src/google/protobuf/map.h
index 7d9cc5c5..a75fb786 100644
--- a/src/google/protobuf/map.h
+++ b/src/google/protobuf/map.h
@@ -48,6 +48,10 @@
#include <google/protobuf/map_type_handler.h>
#include <google/protobuf/stubs/hash.h>
+#if LANG_CXX11
+#include <initializer_list>
+#endif
+
namespace google {
namespace protobuf {
@@ -741,7 +745,7 @@ class Map {
return true;
}
} else if (GOOGLE_PREDICT_FALSE(new_size <= lo_cutoff &&
- num_buckets_ > kMinTableSize)) {
+ num_buckets_ > kMinTableSize)) {
size_type lg2_of_size_reduction_factor = 1;
// It's possible we want to shrink a lot here... size() could even be 0.
// So, estimate how much to shrink by making sure we don't shrink so
@@ -1113,6 +1117,11 @@ class Map {
}
}
}
+#if LANG_CXX11
+ void insert(std::initializer_list<value_type> values) {
+ insert(values.begin(), values.end());
+ }
+#endif
// Erase and clear
size_type erase(const key_type& key) {