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

Make the capacity of this array at least the specified `numElements`, assuming the number of unique elements within this array does not increase&period; This method has no effect if the current capacity meets or exceeds the required capacity&period; The behavior is undefined unless `false &equals;&equals; isEmpty() &verbar;&verbar; 0 &equals;&equals; numElements`&period; Note that the assumption of not increasing the number of unique elements implies the need for the narrow contract&period;

== Synopsis

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

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


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