std::unordered_map::rehash
void rehash( size_type count ); | | (since C++11) |
|---|
将桶数设置为count并重新散列容器,即,考虑到总的桶数已经改变,将元素放入适当的桶中。如果新的桶数使负载因子大于最大负载因数%28count < size() / max_load_factor()%29,那么新的桶数至少是size() / max_load_factor()...
参数
count | - | new number of buckets |
|---|
返回值
%280%29
复杂性
平均情况线性在容器的大小,最坏的情况是二次型的。
注记
rehash(0)可用于强制无条件重散,例如暂停自动重哈希(通过临时增加)。max_load_factor()...
另见
reserve | reserves space for at least the specified number of elements.This regenerates the hash table. (public member function) |
|---|
© cppreference.com在CreativeCommonsAttribution下授权-ShareAlike未移植许可v3.0。
本文档系腾讯云开发者社区成员共同维护,如有问题请联系 cloudcommunity@tencent.com

