void reserve( size_type new_cap = 0 );
void reserve( size_type new_cap);
|(2)|| (since C++20)
1) Informs a
std::basic_stringobject of a planned change in size, so that it can manage the storage allocation appropriately.
If a capacity change takes place, all iterators and references, including the past-the-end iterator, are invalidated.
|new_cap||-||new capacity of the string|
At most linear in the size() of the string
| returns the number of characters that can be held in currently allocated storage |
(public member function)