std::unordered_map::rehash(3)
π std::unordered_map::rehash(3) β C++ Standard Libary bestie page β¨
okay so we're in the C++ Standard Libary manual, and this page is literally all about std::unordered_map::rehash(3). it's giving member-function main character energy, no cap π«Ά
πΈ NAME πΈ
std::unordered_map::rehash β std::unordered_map::rehash π
β¨ Synopsis β¨
void rehash( size_type count ); (since C++11)
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. periodt π
π Parameters π
countβ lower bound for the new number of buckets. that's the whole assignment bestie π
π¦ Return value π¦
(none) β literally none, it's giving void energy π
π₯ Complexity π₯
- Average case: linear in the size of the container.
- Worst case: 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(). iconic little trick, iykyk π
π See also π
reserveβ reserves space for at least the specified number of elements and regenerates the hash table (public member function). slay π
mwah π this page is from source/version http://cppreference.com, dated 2024.06.10 β byeee bestie, 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