diff --git a/examples/basic.cc b/examples/basic.cc index f83d6fb..2b7f050 100644 --- a/examples/basic.cc +++ b/examples/basic.cc @@ -7,7 +7,12 @@ using phmap::flat_hash_map; int main() { // Create an unordered_map of three strings (that map to strings) - flat_hash_map email; + flat_hash_map email = + { + { "tom", "tom@gmail.com"}, + { "jeff", "jk@gmail.com"}, + { "jim", "jimg@microsoft.com"} + }; // Iterate and print keys and values for (const auto& n : email) diff --git a/parallel_hashmap/phmap.h b/parallel_hashmap/phmap.h index 48573b9..f5db1cb 100644 --- a/parallel_hashmap/phmap.h +++ b/parallel_hashmap/phmap.h @@ -1154,7 +1154,7 @@ public: raw_hash_set(const raw_hash_set& that, const allocator_type& a) : raw_hash_set(0, that.hash_ref(), that.eq_ref(), a) { - reserve(that.capacity()); + rehash(that.capacity()); // operator=() should preserve load_factor // Because the table is guaranteed to be empty, we can do something faster // than a full `insert`. for (const auto& v : that) {