aboutsummaryrefslogtreecommitdiff
path: root/absl/container
diff options
context:
space:
mode:
authorAbseil Team <absl-team@google.com>2024-06-03 13:27:55 -0700
committerCopybara-Service <copybara-worker@google.com>2024-06-03 13:30:08 -0700
commit65dfbf2b51f0d152b7beb9c93186992d347b37a5 (patch)
tree7039c25e1d7ca8694661be236c3d91d067e0c8bd /absl/container
parentd06b82773e2306a99a8971934fb5845d5c04a170 (diff)
downloadabseil-65dfbf2b51f0d152b7beb9c93186992d347b37a5.tar.gz
abseil-65dfbf2b51f0d152b7beb9c93186992d347b37a5.tar.bz2
abseil-65dfbf2b51f0d152b7beb9c93186992d347b37a5.zip
Clarify function comment for `erase` by stating that this idiom only works for "some" standard containers.
If you use this idiom with `std::vector` or `absl::btree_map` you can end up either skipping elements or dereferencing an invalid iterator. PiperOrigin-RevId: 639892758 Change-Id: Ic5c213667b4b1e8c39813ee237aaffe320a8eb27
Diffstat (limited to 'absl/container')
-rw-r--r--absl/container/internal/raw_hash_set.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/absl/container/internal/raw_hash_set.h b/absl/container/internal/raw_hash_set.h
index 1f677a4e..9ef9a6be 100644
--- a/absl/container/internal/raw_hash_set.h
+++ b/absl/container/internal/raw_hash_set.h
@@ -3105,7 +3105,7 @@ class raw_hash_set {
// this method returns void to reduce algorithmic complexity to O(1). The
// iterator is invalidated, so any increment should be done before calling
// erase. In order to erase while iterating across a map, use the following
- // idiom (which also works for standard containers):
+ // idiom (which also works for some standard containers):
//
// for (auto it = m.begin(), end = m.end(); it != end;) {
// // `erase()` will invalidate `it`, so advance `it` first.