diff options
-rw-r--r-- | absl/container/flat_hash_map.h | 6 | ||||
-rw-r--r-- | absl/container/flat_hash_set.h | 6 |
2 files changed, 4 insertions, 8 deletions
diff --git a/absl/container/flat_hash_map.h b/absl/container/flat_hash_map.h index 006e478a..e6bdbd9e 100644 --- a/absl/container/flat_hash_map.h +++ b/absl/container/flat_hash_map.h @@ -228,11 +228,9 @@ class flat_hash_map : public absl::container_internal::raw_hash_map< // NOTE: returning `void` in this case is different than that of STL // containers in general and `std::unordered_map` in particular (which // return an iterator to the element following the erased element). If that - // iterator is needed, copy the iterator before erasing: + // iterator is needed, simply post increment the iterator: // - // // `erase()` will invalidate `it`, so advance `it` first. - // auto copy_it = it++; - // m.erase(copy_it); + // map.erase(it++); // // iterator erase(const_iterator first, const_iterator last): // diff --git a/absl/container/flat_hash_set.h b/absl/container/flat_hash_set.h index 7bb1fa90..4938c703 100644 --- a/absl/container/flat_hash_set.h +++ b/absl/container/flat_hash_set.h @@ -220,11 +220,9 @@ class flat_hash_set // NOTE: returning `void` in this case is different than that of STL // containers in general and `std::unordered_set` in particular (which // return an iterator to the element following the erased element). If that - // iterator is needed, copy the iterator before erasing: + // iterator is needed, simply post increment the iterator: // - // // `erase()` will invalidate `it`, so advance `it` first. - // auto copy_it = it++; - // set.erase(copy_it); + // set.erase(it++); // // iterator erase(const_iterator first, const_iterator last): // |