◐ Shell
clean mode source ↗

std::unordered_map::reserve – cppreference.com

Aus cppreference.com

<metanoindex/>

<tbody> </tbody>

void reserve( size_type count );

(seit C++11)

Legt die Anzahl der Schaufeln an der Zahl, mussten mindestens count Elemente ohne Überschreitung der maximalen Auslastung und rehashs der Behälter unterzubringen, stellt also die Elemente in die entsprechenden Eimer bedenkt, dass Gesamtzahl der Eimer hat sich geändert. Effektiv nennt rehash(std::ceil(count / max_load_factor())) .

Original:

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())).

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

Parameter

count -

neue Kapazität des Behälters

Original:

new capacity of the container

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

Rückgabewert

(None)

Original:

(none)

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

Komplexität

durchschnittlichen Fall linear in der Größe des Behälters, schlimmsten Fall quadratische .

Original:

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

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

Siehe auch

reserves at least the specified number of buckets.
This regenerates the hash table.
(öffentliche Elementfunktion) [edit]