diff options
author | Adam Cozzette <acozzette@google.com> | 2017-12-01 10:05:10 -0800 |
---|---|---|
committer | Adam Cozzette <acozzette@google.com> | 2017-12-01 10:05:10 -0800 |
commit | 92a7e778e7394386f413cec28d67a07630f784b1 (patch) | |
tree | cb5673c7c09b0d3905b48a24765d07e423bc5b30 /src/google/protobuf/map.h | |
parent | ce0a53273a400369932ba788d17500336a6ecaad (diff) | |
download | protobuf-92a7e778e7394386f413cec28d67a07630f784b1.tar.gz protobuf-92a7e778e7394386f413cec28d67a07630f784b1.tar.bz2 protobuf-92a7e778e7394386f413cec28d67a07630f784b1.zip |
Integrated internal changes from Google
Diffstat (limited to 'src/google/protobuf/map.h')
-rw-r--r-- | src/google/protobuf/map.h | 11 |
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) { |