Boost.URL Logo

PrevUpHomeNext
segments::push_back

Add an element to the end.

Synopsis
void
push_back(
    string_view s);
Description

This function appends a segment containing the percent-encoded string s to the end of the container. The percent-encoding must be valid or else an exception is thrown. All end iterators are invalidated.

Example
url u = parse_relative_uri( "/path/to" );

u.segments().push_back( "file.txt" );

assert( u.encoded_path() == "/path/to/file.txt" );
Exception Safety

Strong guarantee. Calls to allocate may throw. Exceptions thrown on invalid input.

Parameters

Name

Description

s

The string to add

Exceptions

Type

Thrown On

std::invalid_argument

invalid percent-encoding


PrevUpHomeNext