std::unorde..._load_factor(3)

πŸ“¦ version 2024.07.05, in nixpkgs unstable, opensuse-leap 16.0

🌸 NAME 🌸

hey bestie, welcome to the std::unorde..._load_factor(3) page πŸ’– it’s from the C++ Standard Libary (their spelling, not mine 😭) and it’s all about std::unordered_map::max_load_factor. The NAME section is literally the same name twice: std::unordered_map::max_load_factor β€” std::unordered_map::max_load_factor. iconic πŸ’…


✨ Synopsis ✨

Two overloads, both since C++11 β€” yes ma’am πŸŽ€

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

okay so this function manages the maximum load factor β€” that’s literally the number of elements per bucket πŸ¦‹ The container automatically increases the number of buckets if the load factor exceeds this threshold. periodt.

  1. Returns the 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) β€” like, literally nothing returned, bestie πŸ™ˆ

🫢 Complexity 🫢

Constant. no notes, just constant energy ✨


πŸ‘‘ See also πŸ‘‘

  • load_factor β€” returns average number of elements per bucket (public member function)

πŸ’‹ that’s the whole page! source: http://cppreference.com, version/date: 2024.06.10, page tag: std::unorde..._load_factor(3). mwah πŸ’…

πŸ“¦ where this page comes from