The vector::max_size() is a built-in function in C++ STL which returns the maximum number of elements that can be held by the vector container.
Parameters: The function does not accept any parameters.
Return value: The function returns the maximum numbers that can fit into the vector container.
Program below illustrates the above function:
max_size of vector 1 = 4611686018427387903 max_size of vector 2 = 4611686018427387903