[#BloombergLP-bdlc-PackedIntArray-0b-reserveCapacity-0e]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bdlc.adoc[bdlc]::xref:BloombergLP/bdlc/PackedIntArray-0b.adoc[PackedIntArray]::reserveCapacity
:relfileprefix: ../../../
:mrdocs:

Reserve capacity for `numElements` with values up to `maxValue`&period;

== Synopsis

Declared in `&lt;bdlc&lowbar;packedintarray&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
void
reserveCapacity(
    std::size&lowbar;t numElements,
    TYPE maxValue);
----

== Description

Make the capacity of this array at least the specified `numElements`&period; The specified `maxValue` denotes the maximum element value that will be subsequently added to this array&period; After this call `numElements` having values in the range `&lsqb;0, maxValue&rsqb;` are guaranteed to not cause a reallocation&period; This method has no effect if the current capacity meets or exceeds the required capacity&period; The behavior is undefined unless `0 &lt;&equals; maxValue`&period;

== Parameters

[cols="1,4"]
|===
| Name| Description
| *numElements*
| minimum number of elements to reserve for
| *maxValue*
| maximum element value expected after this call
|===


[.small]#Created with https://www.mrdocs.com[MrDocs]#
