forked from boostorg/unordered
Update docs for rehash/reserve for unordered_map
This commit is contained in:
@ -1566,7 +1566,9 @@ Effects:;; Changes the container's maximum load factor, using `z` as a hint.
|
|||||||
void rehash(size_type n);
|
void rehash(size_type n);
|
||||||
```
|
```
|
||||||
|
|
||||||
Changes the number of buckets so that there at least `n` buckets, and so that the load factor is less than the maximum load factor.
|
Changes the number of buckets so that there are at least `n` buckets, and so that the load factor is less than or equal to the maximum load factor. When applicable, this will either grow or shrink the `bucket_count()` associated with the container.
|
||||||
|
|
||||||
|
When `size() == 0`, `rehash(0)` will deallocate the underlying buckets array.
|
||||||
|
|
||||||
Invalidates iterators, and changes the order of elements. Pointers and references to elements are not invalidated.
|
Invalidates iterators, and changes the order of elements. Pointers and references to elements are not invalidated.
|
||||||
|
|
||||||
@ -1580,6 +1582,10 @@ Throws:;; The function has no effect if an exception is thrown, unless it is thr
|
|||||||
void reserve(size_type n);
|
void reserve(size_type n);
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Equivalent to `a.rehash(ceil(n / a.max_load_factor()))`, or `a.rehash(1)` if `n > 0` and `a.max_load_factor() == std::numeric_limits<float>::infinity()`.
|
||||||
|
|
||||||
|
Similar to `rehash`, this function can be used to grow or shrink the number of buckets in the container.
|
||||||
|
|
||||||
Invalidates iterators, and changes the order of elements. Pointers and references to elements are not invalidated.
|
Invalidates iterators, and changes the order of elements. Pointers and references to elements are not invalidated.
|
||||||
|
|
||||||
[horizontal]
|
[horizontal]
|
||||||
|
Reference in New Issue
Block a user