Skip to content

Commit

Permalink
Update comments to make it explicit that moving a flat_hash_{set,map}…
Browse files Browse the repository at this point in the history
… can cause pointers to elements to be invalidated.

PiperOrigin-RevId: 578920671
Change-Id: Ica40db48d5565b606e5e5f501c1305612b193d4d
  • Loading branch information
ezbr authored and copybara-github committed Nov 2, 2023
1 parent 7135ec6 commit 1a03fb9
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion absl/container/flat_hash_map.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion absl/container/flat_hash_set.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 1a03fb9

Please sign in to comment.