Set the maximum load factor permitted by this hash table.

Synopsis

Declared in <bslstl_hashtable.h>

void
setMaxLoadFactor(float newMaxLoadFactor);

Description

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. If 'newMaxLoadFactor < loadFactor', allocate at least enough buckets to re‐establish 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. The behavior is undefined unless 0 < maxLoadFactor.

Parameters

Name

Description

newMaxLoadFactor

new maximum load factor (must be positive)

Created with MrDocs