std::basic_string<CharT,Traits,Allocator>::push_back
cppreference.com
<tbody>
</tbody>
<tbody class="t-dcl-rev ">
</tbody><tbody>
</tbody>
void push_back( CharT ch ); |
( C++20) | |
constexpr void push_back( CharT ch ); |
( C++20) | |
ch .
| ch |
()
.
size() > max_size(), std::length_error.
#include <iomanip>
#include <iostream>
#include <string>
int main()
{
std::string str{" "};
std::cout << "1) " << std::quoted(str) << ", : " << str.size() << '\n';
str.push_back('!');
std::cout << "2) " << std::quoted(str) << ", : " << str.size() << '\n';
}
:
1) " ", : 29
2) " !", : 30
C++:
| LWG 7 | C++98 | (1) C++ (2) const CharT
|
(1) (2) CharT
|
| LWG 847 | C++98 |
(DR*) |
(public -) |