std::basic_string<CharT,Traits,Allocator>::push_back_C++中文网

C++ 参考手册

位置:首页 > C++ 参考手册 >字符串库 >std::basic_string > std::basic_string<CharT,Traits,Allocator>::push_back

后附给定字符 ch 到字符串尾。

参数

ch - 要后附的字符

返回值

(无)

复杂度

均摊常数。

异常

若因任何原因抛出异常,则此函数无效果(强异常保证)。 (C++11 起)

若操作将导致 size() > max_size() ,则抛出 std::length_error 。

参阅