Boost.URL Logo

PrevUpHomeNext
segments::erase (2 of 2 overloads)

Erase a range of elements.

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

This function erases the elements in the range [first, last), which must be a valid range in the container. All references and iterators starting from first and up to and including the last element and end iterators are invalidated.

Preconditions

[first, last) is a valid range in this container.

Example
url u = parse_relative_uri( "/path/to/the/file.txt" );

segments se = u.segments();

se.erase( se.begin() + 1, se.begin() + 3 );

assert( u.encoded_path() == "/path/file.txt" );
Return Value

An iterator following the last element erased.

Parameters

Name

Description

first

The beginning of the range to erase.

last

The end of the range to erase.

Exceptions

Type

Thrown On

std::invalid_argument

invalid percent-encoding


PrevUpHomeNext