summaryrefslogtreecommitdiff
path: root/absl/container
diff options
context:
space:
mode:
authorGravatar Evan Brown <ezb@google.com>2023-11-02 11:21:24 -0700
committerGravatar Copybara-Service <copybara-worker@google.com>2023-11-02 11:22:02 -0700
commit1a03fb9dd1c533e42b6d7d1ebea85b448a07e793 (patch)
tree60b015ce945433a1126d4f2ca6518b1fbc9f9f86 /absl/container
parent7135ec61db16de640749194838e4337034451f8d (diff)
Update comments to make it explicit that moving a flat_hash_{set,map} can cause pointers to elements to be invalidated.
PiperOrigin-RevId: 578920671 Change-Id: Ica40db48d5565b606e5e5f501c1305612b193d4d
Diffstat (limited to 'absl/container')
-rw-r--r--absl/container/flat_hash_map.h2
-rw-r--r--absl/container/flat_hash_set.h2
2 files changed, 2 insertions, 2 deletions
diff --git a/absl/container/flat_hash_map.h b/absl/container/flat_hash_map.h
index 8f4d9939..5304477d 100644
--- a/absl/container/flat_hash_map.h
+++ b/absl/container/flat_hash_map.h
@@ -64,7 +64,7 @@ struct FlatHashMapPolicy;
// `insert()`, provided that the map is provided a compatible heterogeneous
// hashing function and equality operator.
// * Invalidates any references and pointers to elements within the table after
-// `rehash()`.
+// `rehash()` and when the table is moved.
// * Contains a `capacity()` member function indicating the number of element
// slots (open, deleted, and empty) within the hash map.
// * Returns `void` from the `erase(iterator)` overload.
diff --git a/absl/container/flat_hash_set.h b/absl/container/flat_hash_set.h
index c789c7ef..a94a82a0 100644
--- a/absl/container/flat_hash_set.h
+++ b/absl/container/flat_hash_set.h
@@ -60,7 +60,7 @@ struct FlatHashSetPolicy;
// that the set is provided a compatible heterogeneous hashing function and
// equality operator.
// * Invalidates any references and pointers to elements within the table after
-// `rehash()`.
+// `rehash()` and when the table is moved.
// * Contains a `capacity()` member function indicating the number of element
// slots (open, deleted, and empty) within the hash set.
// * Returns `void` from the `erase(iterator)` overload.