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.5 basic_­string​::​erase [string.erase]

basic_string& erase(size_type pos = 0, size_type n = npos);
Throws: out_­of_­range if pos > size().
Effects: Determines the effective length xlen of the string to be removed as the smaller of n and size() - pos.
Removes the characters in the range [begin() + pos, begin() + pos + xlen).
Returns: *this.
iterator erase(const_iterator p);
Expects: p is a valid dereferenceable iterator on *this.
Throws: Nothing.
Effects: Removes the character referred to by p.
Returns: An iterator which points to the element immediately following p prior to the element being erased.
If no such element exists, end() is returned.
iterator erase(const_iterator first, const_iterator last);
Expects: first and last are valid iterators on *this.
[first, last) is a valid range.
Throws: Nothing.
Effects: Removes the characters in the range [first, last).
Returns: An iterator which points to the element pointed to by last prior to the other elements being erased.
If no such element exists, end() is returned.
void pop_back();
Expects: !empty().
Throws: Nothing.
Effects: Equivalent to erase(end() - 1).