void reserve( size_type new_cap = 0 );
std::basic_string object of a planned change in size, so that it can manage the storage allocation appropriately.
new_capis greater than the current capacity(), new storage is allocated, and capacity() is made equal or greater than
new_capis less than the current capacity(), this is a non-binding shrink request.
new_capis less than the current size(), this is a non-binding shrink-to-fit request equivalent to shrink_to_fit() (since C++11).
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)