[ Web Proxy ]
URL:
Viewing: https://ru.cppreference.com/cpp/container/unordered_multiset/reserve [Back]  [Original]

std::unordered_multiset::reserve cppreference.com
cppreference.com

std::unordered_multiset::reserve

cppreference.com

<metanoindex/>

 
C++
(C++20)
(C++20)
(C++11)
(C++20)
/
(C++11)
(C++11)
(C++11)
(C++17)
 
 
 
<tbody> </tbody>
void reserve( size_type count );
( C++11)
count rehashes , , , . rehash(std::ceil(count / max_load_factor())).
:
Sets the number of buckets to the number needed to accomodate at least count elements without exceeding maximum load factor and rehashes the container, i.e. puts the elements into appropriate buckets considering that total number of buckets has changed. Effectively calls rehash(std::ceil(count / max_load_factor())).
Google.
. .

count
:
new capacity of the container
Google.
. .

()

, .
:
average case linear in the size of the container, worst case quadratic.
Google.
. .

.

(C++11)
-
(public -) []

Web Proxy Viewer  |  New URL  |  Original Page