max_size [C++ Reference]
Keywords: stl,vector,max_size
Date: 2008-10-14T15:42:10-0700

## max_size

Syntax:

        #include <vector>
        size_type max_size() const;

The max_size() function returns the maximum number of elements that the vector can hold. The max_size() function should not be confused with the size or capacity functions, which return the number of elements currently in the vector and the the number of elements that the vector will be able to hold before more memory will have to be allocated, respectively.

Related Topics: size, capacity