diff options
author | Evan Brown <ezb@google.com> | 2023-07-26 10:33:14 -0700 |
---|---|---|
committer | Copybara-Service <copybara-worker@google.com> | 2023-07-26 10:34:46 -0700 |
commit | 7fc3c7fe7283a8b04fe0f79fe6180b6e688a565f (patch) | |
tree | e4c8a51e15a7d5d27597b3703f1ba5cb0dbfef52 /absl/container/node_hash_map.h | |
parent | c108cd0382a3659eaf2981b22392b4d5fbc122db (diff) |
Change the API constraints of erase(const_iterator, const_iterator) so that calling erase(begin(), end()) resets reserved growth.
PiperOrigin-RevId: 551248712
Change-Id: I34755c63e3ee40da4ba7047e0d24eec567d28173
Diffstat (limited to 'absl/container/node_hash_map.h')
-rw-r--r-- | absl/container/node_hash_map.h | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/absl/container/node_hash_map.h b/absl/container/node_hash_map.h index dc8d7d9a..a396de2e 100644 --- a/absl/container/node_hash_map.h +++ b/absl/container/node_hash_map.h @@ -226,7 +226,11 @@ class node_hash_map // iterator erase(const_iterator first, const_iterator last): // // Erases the elements in the open interval [`first`, `last`), returning an - // iterator pointing to `last`. + // iterator pointing to `last`. The special case of calling + // `erase(begin(), end())` resets the reserved growth such that if + // `reserve(N)` has previously been called and there has been no intervening + // call to `clear()`, then after calling `erase(begin(), end())`, it is safe + // to assume that inserting N elements will not cause a rehash. // // size_type erase(const key_type& key): // |