std::unordered_multiset<Key,Hash,KeyEqual,Allocator>::reserve
来自cppreference.com
< cpp | container | unordered
multiset
容器库
std::unordered_multiset
成员函数 | ||||
迭代器 | ||||
容量 | ||||
修改器 | ||||
(C++17)
|
||||
(C++17)
|
||||
查找 | ||||
(C++20)
|
||||
桶接口 | ||||
哈希策略 | ||||
unordered_multiset::reserve
|
||||
观察器 | ||||
非成员函数 | ||||
(C++20
前)
|
||||
(C++20)
|
||||
推导指引(C++17) |
void
reserve(
size_type count );
|
(C++11 起) | |
设置桶数为适应至少 count
个元素,而不超出最大加载因子所需的数,并重哈希容器,即考虑桶数已更改后将元素放进适合的桶。等效地调用 rehash(std::ceil(count / max_load_factor())) 。
参数
count | - | 容器的新容量 |
返回值
(无)
复杂度
平均情况与容器大小成线性,最坏情况成平方。
参阅
(C++11)
|
为至少为指定数量的桶预留存储空间并重新生成散列表 (公开成员函数) |