libstdc++
GNU C++ library
Loading...
Searching...
No Matches

◆ resize() [2/4]

template<typename _CharT, typename _Traits, typename _Alloc>
void std::basic_string< _CharT, _Traits, _Alloc >::resize ( size_type __n)
inline

Resizes the string to the specified number of characters.

Parameters
__nNumber of characters the string should contain.

This function will resize the string to the specified length. If the new size is smaller than the string's current size the string is truncated, otherwise the string is extended and new characters are default-constructed. For basic types such as char, this means setting them to 0.

Definition at line 999 of file cow_string.h.

1000 { this->resize(__n, _CharT()); }
constexpr void resize(size_type __n, _CharT __c)
Resizes the string to the specified number of characters.
Managing sequences of characters and character-like objects.