std::unorde...:bucket_size(3)
πΈ std::unordered_set::bucket_size β the std::unordered_set::bucket_size glow-up π
okay so bestie, welcome to the C++ Standard Libary manual (yes that's how it's spelled up top, we don't gatekeep typos here π
). this lil page is all about std::unordered_set::bucket_size, and honestly? it's giving "small function, big main character energy" β¨
β¨ NAME β¨
std::unordered_set::bucket_size β literally just std::unordered_set::bucket_size, that's the whole name, no notes π
π¦ Synopsis π¦
size_type bucket_size( size_type n ) const; (since C++11)
so what does it actually do? it returns the number of elements in the bucket with index n. that's it. that's the vibe. a bucket census, if you will πͺ£β¨
also worth flagging: this has been a thing since C++11, so if you're on some ancient compiler, bestieβ¦ my condolences π
π Parameters π
nβ the index of the bucket to examine π like, which bucket are we peeking into, bestie?
β Return value β
the number of elements in the bucket n. no cap, that's the whole return value π₯
π Complexity π
Linear in the size of the bucket n. so it's proportional to how stuffed that one bucket is β big bucket, more work, iykyk π«Ά
π See also π
bucket_countβ returns the number of buckets (a public member function) π
and that's the page!! go forth and count your buckets, you absolute icon ππ
source/version: http://cppreference.com Β· 2024.06.10 β mwah, catch you in the next manpage bestie π§ββοΈππ
π¦ 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