std::basic_string::shrink_to_fit

From Cppreference

Jump to: navigation, search
void shrink_to_fit();
(C++11 feature)

Requests the removal of unused capacity.

It is a non-binding request to reduce capacity to size. It depends on the implementation if the request is fulfilled.

Contents

[edit] Parameters

(none)

[edit] Return value

(none)

[edit] Complexity

Constant

[edit] See also

size
returns the number of characters
(public member function)
capacity
returns the number of characters that can be held in currently allocated storage
(public member function)