[#bsl-unordered_set-0d2d-reserve] = xref:bsl.adoc[bsl]::xref:bsl/unordered_set-0d2d.adoc[unordered_set]::reserve :relfileprefix: ../../ :mrdocs: Reserve capacity for at least `numElements` elements. == Synopsis Declared in `<bslstl_unorderedset.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- void reserve(xref:bsl/unordered_set-0d2d/size_type.adoc[size_type] numElements); ---- == Description Increase the number of buckets of this set to a quantity such that the ratio between the specified `numElements` and this quantity does not exceed `max_load_factor`. Note that this guarantees that, after the reserve, elements can be inserted to grow the container to `size() == numElements` without rehashing. Also note that memory allocations may still occur when growing the container to `size() == numElements`. Also note that this operation has no effect if `numElements <= size()`. == Parameters [cols="1,4"] |=== | Name| Description | *numElements* | number of elements to reserve capacity for |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#