std::unorde...et::reserve(3)

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

πŸ’– NAME πŸ’–

okay bestie, this is the std::unordered_multiset::reserve page from the C++ Standard Libary manual πŸ’…

  • std::unordered_multiset::reserve β€” yep, the original NAME line says it twice, and honestly? iconic πŸ‘‘.

πŸ“œ Synopsis πŸ“œ

void reserve( size_type count );  (since C++11)

Sets the number of buckets to the number needed to accommodate at least count elements without exceeding the maximum load factor, and rehashes the container β€” i.e., puts the elements into appropriate buckets considering that the total number of buckets has changed. Effectively calls rehash(std::ceil(count / max_load_factor())). ✨

πŸŽ€ Parameters πŸŽ€

  • count β€” new capacity of the container.

🫢 Return value 🫢

  • (none) β€” no return value, bestie. She gives you nothing back πŸ’€

πŸ”₯ Complexity πŸ”₯

  • Average case: linear in the size of the container.
  • Worst case: quadratic.

🌈 See also 🌈

  • rehash β€” reserves at least the specified number of buckets and regenerates the hash table (public member function).

that’s the std::unorde...et::reserve(3) page, source/version: http://cppreference.com, dated 2024.06.10 β€” mwah πŸ’‹πŸ«Άβœ¨

πŸ“¦ where this page comes from