string::erase

Erase characters from the string.

Synopsis

Description

Erases num characters from the string, starting at pos. num is determined as the smaller of count and size() - pos.

Exception Safety

Strong guarantee.

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

Return Value

*this

Return Value

An iterator referring to character immediately following the erased character, or end() if one does not exist.

Return Value

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

Parameters

Name Description

pos

The index to erase at. The default argument for this parameter is 0.

count

The number of characters to erase. The default argument for this parameter is npos.

first

An iterator representing the first character to erase.

last

An iterator one past the last character to erase.

Exceptions

Type Thrown On

boost::system::system_error

pos > size().