std::basic_string::operator+=

From Cppreference

Jump to: navigation, search
basic_string& operator+=( const basic_string& str );
(1)
basic_string& operator+=( CharT ch );
(2)
basic_string& operator+=( CharT* s );
(3)
basic_string& operator+=( std::initializer_list<CharT> ilist );
(4) (C++11 feature)

Appends addinional characters to the string.

1) Appends string str

2) Appends character ch

3) Appends the null-terminated character string pointed to by s.

4) Appends characters in the initializer list ilist.

Contents

[edit] Parameters

ch - character value to append
str - string to append
s - pointer to a null-terminated character string to append
init - initializer list with the characters to append

[edit] Return value

*this

[edit] Complexity

1) linear in size of str

2) constant

3) linear in size of s

4) linear in size of init

[edit] Example

[edit] See also

assign
assign characters to a string
(public member function)