public member function
[C++98] size_t max_size() const; [C++11] size_t max_size() const noexcept;
Return maximum size of string
This is the maximum potential length the string can reach due to known system or library implementation limitations, but the object is not guaranteed to be able to reach that length: it can still fail to allocate storage at any point before that length is reached.
Return ValueThe maximum length the string can reach.
size_t is an unsigned integral type.
A possible output for this program could be:
Unspecified, but generally constant.
Iterator validityNo changes.
Data racesThe object is accessed.
Exception safetyNo-throw guarantee: this member function never throws exceptions.