[#bsl-vector-00d-max_size] = xref:bsl.adoc[bsl]::xref:bsl/vector-00d.adoc[vector]::max_size :relfileprefix: ../../ :mrdocs: Return a theoretical upper bound on this vector's size. == Synopsis Declared in `<bslstl_vector.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- xref:bsl/vector-00d/size_type.adoc[vector<VALUE_TYPE, ALLOCATOR>::size_type] max_size() const noexcept; ---- == Description Return a theoretical upper bound on the largest number of elements that this vector could possibly hold. 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. Also note that requests to create a vector longer than this number of elements are guaranteed to raise a `std::length_error` exception. == Return Value theoretical upper bound on the number of elements this vector can hold [.small]#Created with https://www.mrdocs.com[MrDocs]#