Boost C++ Libraries

...one of the most highly regarded and expertly designed C++ library projects in the world. Herb Sutter and Andrei Alexandrescu, C++ Coding Standards

This is the documentation for a snapshot of the master branch, built from commit 7789ef3d8d.
PrevUpHomeNext
string::erase (3 of 3 overloads)

Erase a range from the string.

Synopsis
iterator
erase(
    const_iterator first,
    const_iterator last);
Description

Erases the characters in the range {first, last).

Precondition

{first, last}shall be valid within

{data(), data() + size()}
Exception Safety

Strong guarantee.

Remarks

All references, pointers, or iterators referring to contained elements are invalidated. Any past-the-end iterators are also invalidated.

Return Value

An iterator referring to the character last previously referred to, or end() if one does not exist.

Parameters

Name

Description

first

An iterator representing the first character to erase.

last

An iterator one past the last character to erase.


PrevUpHomeNext