24 Strings library [strings]

24.3 String classes [string.classes]

24.3.2 Class template basic_ยญstring [basic.string]

24.3.2.6 basic_ยญstring modifiers [string.modifiers]

24.3.2.6.2 basic_ยญstringโ€‹::โ€‹append [string.append]

basic_string& append(const basic_string& str);

Effects: Calls append(str.data(), str.size()).

Returns: *this.

basic_string& append(const basic_string& str, size_type pos, size_type n = npos);

Throws: out_ยญof_ยญrange if pos > str.size().

Effects: Determines the effective length rlen of the string to append as the smaller of n and str.size() - pos and calls append(str.data() + pos, rlen).

Returns: *this.

basic_string& append(basic_string_view<charT, traits> sv);

Effects: Equivalent to: return append(sv.data(), sv.size());

template<class T> basic_string& append(const T& t, size_type pos, size_type n = npos);

Throws: out_ยญof_ยญrange if pos > sv.size().

Effects: Creates a variable, sv, as if by basic_ยญstring_ยญview<charT, traits> sv = t. Determines the effective length rlen of the string to append as the smaller of n and sv.size() - pos and calls append(sv.data() + pos, rlen).

Remarks: This function shall not participate in overload resolution unless is_ยญconvertible_ยญv<const T&, basic_ยญstring_ยญview<charT, traits>> is true and is_ยญconvertible_ยญv<const T&, const charT*> is false.

Returns: *this.

basic_string& append(const charT* s, size_type n);

Requires: s points to an array of at least n elements of charT.

Throws: length_ยญerror if size() + n > max_ยญsize().

Effects: The function replaces the string controlled by *this with a string of length size() + n whose first size() elements are a copy of the original string controlled by *this and whose remaining elements are a copy of the initial n elements of s.

Returns: *this.

basic_string& append(const charT* s);

Requires: s points to an array of at least traitsโ€‹::โ€‹length(s) + 1 elements of charT.

Effects: Calls append(s, traitsโ€‹::โ€‹length(s)).

Returns: *this.

basic_string& append(size_type n, charT c);

Effects: Equivalent to append(basic_ยญstring(n, c)).

Returns: *this.

template<class InputIterator> basic_string& append(InputIterator first, InputIterator last);

Requires: [first, last) is a valid range.

Effects: Equivalent to append(basic_ยญstring(first, last, get_ยญallocator())).

Returns: *this.

basic_string& append(initializer_list<charT> il);

Effects: Calls append(il.begin(), il.size()).

Returns: *this.

void push_back(charT c);

Effects: Equivalent to append(static_ยญcast<size_ยญtype>(1), c).