Skip to main content

std::unordered_set max_load_factor() method

// (1) Const version
float max_load_factor() const;

// (2) Non-const version
void max_load_factor( float ml );

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) unordered_sets the maximum load factor to ml.

Parameters

  • ml - new maximum load factor unordered_setting

Return value

  • (1) current maximum load factor.
  • (2) (none)

Complexity

Constant - O(1).

Exceptions

(none)

Examples

important

This section requires improvement. You can help by editing this doc page.

This article originates from this CppReference page. It was likely altered for improvements or editors' preference. Click "Edit this page" to see all changes made to this document.
Hover to see the original license.

std::unordered_set max_load_factor() method

// (1) Const version
float max_load_factor() const;

// (2) Non-const version
void max_load_factor( float ml );

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) unordered_sets the maximum load factor to ml.

Parameters

  • ml - new maximum load factor unordered_setting

Return value

  • (1) current maximum load factor.
  • (2) (none)

Complexity

Constant - O(1).

Exceptions

(none)

Examples

important

This section requires improvement. You can help by editing this doc page.

This article originates from this CppReference page. It was likely altered for improvements or editors' preference. Click "Edit this page" to see all changes made to this document.
Hover to see the original license.