[#BloombergLP-bslstl-HashTable-06-rehashForNumBuckets] = xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bslstl.adoc[bslstl]::xref:BloombergLP/bslstl/HashTable-06.adoc[HashTable]::rehashForNumBuckets :relfileprefix: ../../../ :mrdocs: Re‐organize this hash‐table to have at least the specified `newNumBuckets`, preserving the invariant `loadFactor <= maxLoadFactor`. If this function tries to allocate a number of buckets larger than can be represented by this hash table's `SizeType`, a `std::length_error` exception is thrown. This operation provides the strong exception guarantee (see {`bsldoc_glossary`}) unless the `hasher` throws, in which case this operation provides the basic exception guarantee, leaving the hash‐table in a valid, but otherwise unspecified (and potentially empty), state. Note that more buckets than requested may be allocated in order to preserve the bucket allocation strategy of the hash table (but never fewer). == Synopsis Declared in `<bslstl_hashtable.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- void rehashForNumBuckets(xref:BloombergLP/bslstl/HashTable-06/SizeType.adoc[SizeType] newNumBuckets); ---- [.small]#Created with https://www.mrdocs.com[MrDocs]#