std::unorde...iset::rehash(3)
β¨ NAME β¨
Bestie, welcome to std::unorde...iset::rehash(3) from the C++ Standard Libary manual π«Ά β this page is all about std::unordered_multiset::rehash, aka std::unordered_multiset::rehash, the member function that changes your bucket count situation π
πΈ Synopsis πΈ
void rehash( size_type count ); (since C++11)
Okay so this one changes the number of buckets to a value n that is not less than count and satisfies
n >= size() / max_load_factor()
then rehashes the container, i.e. puts the elements into appropriate buckets considering that total number of buckets has changed β¨
π Parameters π
countβ lower bound for the new number of buckets
π Return value π
- (none) β literally nothing comes back, no return value era π
π₯ Complexity π₯
Average case linear in the size of the container, worst case quadratic. Ngl, worst case said quadratic π
π¦ Notes π¦
rehash(0) may be used to force an unconditional rehash, such as after suspension of automatic rehashing by temporarily increasing max_load_factor().
β See also β
reserveβ reserves space for at least the specified number of elements and regenerates the hash table (public member function)
Okay bestie, thatβs the whole page π source/version: http://cppreference.com; version/date: 2024.06.10; page: std::unorde...iset::rehash(3). Now go rehash 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