[#bsl-Vector_Util-computeNewCapacity]
= xref:bsl.adoc[bsl]::xref:bsl/Vector_Util.adoc[Vector&lowbar;Util]::computeNewCapacity
:relfileprefix: ../../
:mrdocs:

Return a capacity that is at least the specified `newLength` and at least twice the specified `capacity` if this is less than the specified `maxSize`, but never more than `maxSize`&period; The behavior is undefined unless `capacity &lt; newLength` and `newLength &lt;&equals; maxSize`&period;

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
static
std::size&lowbar;t
computeNewCapacity(
    std::size&lowbar;t newLength,
    std::size&lowbar;t capacity,
    std::size&lowbar;t maxSize);
----


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