Reserve capacity for at least the specified numEntries.
Synopsis
Declared in <bdlc_flathashmap.h>
void
reserve(std::size_t numEntries);
Description
Change the capacity of this map to at least a capacity that can accommodate the specified numEntries (accounting for the load factor invariant), and redistribute all the contained elements into a new sequence of entries according to their hash values. If `0 == numEntries` and 0 == size()`, the map is returned to the default constructed state. After this call, `load_factor() will be less than or equal to max_load_factor() and all iterators, pointers, and references to elements of this map are invalidated. Note that this method is effectively equivalent to: ` rehash(bsl::ceil(numEntries / max_load_factor())) `
Parameters
Name |
Description |
numEntries |
number of elements to accommodate |
Created with MrDocs