Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions absl/container/flat_hash_map.h
Original file line number Diff line number Diff line change
Expand Up @@ -472,8 +472,13 @@ class ABSL_ATTRIBUTE_OWNER flat_hash_map
// Sets the number of slots in the `flat_hash_map` to the number needed to
// accommodate at least `count` total elements without exceeding the current
// maximum load factor, and may rehash the container if needed. After this
// returns, it is guaranteed that `count - size()` elements can be inserted
// into the `flat_hash_map` without another rehash.
// returns, it is guaranteed that `count - size()` consecutive elements can
// be inserted into the `flat_hash_map` without another rehash.
//
// NOTE: This guarantee only applies to consecutive insertions. Because of
// probing requirements, erased slots may still occupy capacity from the
// perspective of needing a rehash. Therefore, interleaving insertions and
// erasures may trigger a compacting rehash.
using Base::reserve;

// flat_hash_map::at()
Expand Down
9 changes: 7 additions & 2 deletions absl/container/flat_hash_set.h
Original file line number Diff line number Diff line change
Expand Up @@ -406,8 +406,13 @@ class ABSL_ATTRIBUTE_OWNER flat_hash_set
// Sets the number of slots in the `flat_hash_set` to the number needed to
// accommodate at least `count` total elements without exceeding the current
// maximum load factor, and may rehash the container if needed. After this
// returns, it is guaranteed that `count - size()` elements can be inserted
// into the `flat_hash_set` without another rehash.
// returns, it is guaranteed that `count - size()` consecutive elements can
// be inserted into the `flat_hash_set` without another rehash.
//
// NOTE: This guarantee only applies to consecutive insertions. Because of
// probing requirements, erased slots may still occupy capacity from the
// perspective of needing a rehash. Therefore, interleaving insertions and
// erasures may trigger a compacting rehash.
using Base::reserve;

// flat_hash_set::contains()
Expand Down
Loading