[#bsl-deque-0c-reserve]
= xref:bsl.adoc[bsl]::xref:bsl/deque-0c.adoc[deque]::reserve
:relfileprefix: ../../
:mrdocs:

Ensure capacity for `numElements` pushes without invalidating iterators&period;

== Synopsis

Declared in `&lt;bslstl&lowbar;deque&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
void
reserve(xref:bsl/deque-0c/size_type.adoc[size&lowbar;type] numElements);
----

== Description

Change the capacity of this deque such that, after this method returns, iterators remain valid provided that no more than the specified `numElements` objects are pushed to the front or back of the deque after this call&period; If it is already possible to push `numElements` objects to either end of this deque without invalidating iterators, this method has no effect&period; Note that inserting elements into the deque may still incur memory allocation&period; Also note that this method, if it has any effect, will invalidate iterators initialized prior to the call&period; Also note that this method is not part of the C&plus;&plus; standard&period;

== Parameters

[cols="1,4"]
|===
| Name| Description
| *numElements*
| number of end insertions that must not invalidate iterators
|===


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