This is not the amount of storage space currently allocated to the vector (this can be obtained with member vector::capacity), but the maximum potential size the vector could reach due to system or library implementation limitations.
Parameters
noneReturn Value
The maximum number of elements a vector object can have as its content.Member type size_type is an unsigned integral type.
Example
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
|
A possible output for this program could be:
size: 100 capacity: 141 max_size: 1073741823 |
Complexity
Constant.See also
| vector::capacity | Return size of allocated storage capacity (public member function) |
| vector::size | Return size (public member function) |
| vector::resize | Change size (public member function) |
