std::unorde...:load_factor(3)
std::unorde...:load_factor(3) π
okay so bestie, welcome to std::unorde...:load_factor(3) from the C++ Standard Libary manual β yes, that's the manual name, typo and all, I don't make the rules πβ¨
πΈ NAME πΈ
The name is std::unordered_map::load_factor β and the NAME line is literally std::unordered_map::load_factor - std::unordered_map::load_factor, which is giving βI said what I saidβ energy π
β¨ Synopsis β¨
Here's the signature, copied exactly, no edits bestie:
float load_factor() const; (since C++11)
It's been around since C++11, and this function returns the average number of elements per bucket, that is, size() divided by bucket_count(). That's the whole vibe: bucket math, but make it average πͺ£β¨
π Parameters π
(none) β zero parameters, not a single one, periodt π«Ά
π Return value π
Average number of elements per bucket. That's it, that's the return value, and it ate π
π¦ Complexity π¦
Constant. No cap, it's constant complexity β
π See also π
max_load_factorβ manages maximum average number of elements per bucket (public member function)
go check on her, she's iconic π
mwah π this page is from http://cppreference.com, with version/date 2024.06.10 β and the header title vibe is std::unorde...:load_factor(3). byeee, go divide your size() by your bucket_count() responsibly π«Άπ
π¦ where this page comes from
- nixpkgs unstable: stdman 2024.07.05
- opensuse-leap 16.0: stdman 2024.07.05-bp160.1.9 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms