std::unorde...:bucket_size(3)

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

🌸 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