20 Strings library [strings]

20.3 String classes [string.classes]

20.3.2 Class template basic_­string [basic.string]

20.3.2.6 Modifiers [string.modifiers]

20.3.2.6.2 basic_­string​::​append [string.append]

basic_string& append(const basic_string& str);
Effects: Equivalent to: return append(str.data(), str.size());
basic_string& append(const basic_string& str, size_type pos, size_type n = npos);
Effects: Equivalent to:
return append(basic_string_view<charT, traits>(str).substr(pos, n));
template<class T> basic_string& append(const T& t);
Constraints:
  • is_­convertible_­v<const T&, basic_­string_­view<charT, traits>> is true and
  • is_­convertible_­v<const T&, const charT*> is false.
Effects: Equivalent to:
basic_string_view<charT, traits> sv = t;
return append(sv.data(), sv.size());
template<class T> basic_string& append(const T& t, size_type pos, size_type n = npos);
Constraints:
  • is_­convertible_­v<const T&, basic_­string_­view<charT, traits>> is true and
  • is_­convertible_­v<const T&, const charT*> is false.
Effects: Equivalent to:
basic_string_view<charT, traits> sv = t;
return append(sv.substr(pos, n));
basic_string& append(const charT* s, size_type n);
Expects: [s, s + n) is a valid range.
Effects: Appends a copy of the range [s, s + n) to the string.
Returns: *this.
basic_string& append(const charT* s);
Effects: Equivalent to: return append(s, traits::length(s));
basic_string& append(size_type n, charT c);
Effects: Appends n copies of c to the string.
Returns: *this.
template<class InputIterator> basic_string& append(InputIterator first, InputIterator last);
Constraints: InputIterator is a type that qualifies as an input iterator ([container.requirements.general]).
Effects: Equivalent to: return append(basic_­string(first, last, get_­allocator()));
basic_string& append(initializer_list<charT> il);
Effects: Equivalent to: return append(il.begin(), il.size());
void push_back(charT c);
Effects: Equivalent to append(size_­type{1}, c).