[#bsl-vector-0aa9-max_size]
= xref:bsl.adoc[bsl]::xref:bsl/vector-0aa9.adoc[vector&lt;unsigned short&gt;]::max&lowbar;size
:relfileprefix: ../../
:mrdocs:

Return a theoretical upper bound on the largest number of elements that this vector could possibly hold&period; Note that there is no guarantee that the vector can successfully grow to the returned size, or even close to that size without running out of resources&period; Also note that requests to create a vector longer than this number of elements are guaranteed to raise a `std&colon;&colon;length&lowbar;error` exception&period;

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:bsl/vector-0aa9/size_type.adoc[size&lowbar;type]
max&lowbar;size() const noexcept;
----


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