[#BloombergLP-bslstl-HashTable-06-setMaxLoadFactor]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bslstl.adoc[bslstl]::xref:BloombergLP/bslstl/HashTable-06.adoc[HashTable]::setMaxLoadFactor
:relfileprefix: ../../../
:mrdocs:

Set the maximum load factor permitted by this hash table to the specified `newMaxLoadFactor`, where load factor is the statistical mean number of elements per bucket&period; If &apos;newMaxLoadFactor &lt; loadFactor&apos;, allocate at least enough buckets to re&hyphen;establish the invariant `loadFactor &lt;&equals; maxLoadFactor`&period; If this function tries to allocate a number of buckets larger than can be represented by this hash table&apos;s `SizeType`, a `std&colon;&colon;length&lowbar;error` exception is thrown&period; The behavior is undefined unless `0 &lt; maxLoadFactor`&period;

== Synopsis

Declared in `&lt;bslstl&lowbar;hashtable&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
void
setMaxLoadFactor(float newMaxLoadFactor);
----


[.small]#Created with https://www.mrdocs.com[MrDocs]#
