Skip to content

Search topics & cppreference

Search all study topics, concept maps, and 6,587 C++ and C reference pages.

std::unordered_set<Key,Hash,KeyEqual,Allocator>::max_load_factor

Manages the maximum load factor (number of elements per bucket). The container automatically increases the number of buckets if the load factor exceeds this threshold.

NotebookLM
float max_load_factor() const;
(1) (since C++11)
void max_load_factor( float ml );
(2) (since C++11)

Manages the maximum load factor (number of elements per bucket). The container automatically increases the number of buckets if the load factor exceeds this threshold.

1) Returns current maximum load factor.
2) Sets the maximum load factor to ml.

Parameters

ml - new maximum load factor setting

Return value

1) Current maximum load factor.
2) (none)

Complexity

Constant.

See also

returns average number of elements per bucket
(public member function)

Content from this page on cppreference.com, licensed under CC-BY-SA 3.0 and GFDL. Modified: restyled, site navigation removed, code windows added. Offline snapshot of 9 February 2025.