Boost.URL Logo

PrevUpHomeNext
segments::operator= (2 of 2 overloads)

Replace the contents of the container.

Synopsis
segments&
operator=(
    std::initializer_list< string_view > init);
Description

This function replaces the contents with an initializer list of unencoded strings. The behavior is undefined if any string refers to the contents of *this. All iterators and references to elements of the container are invalidated, including the end iterator.

Example
url u = parse_relative_uri( "/path/to/file.txt" );
u.segments() = { "etc", "init.rc" };
assert( u.encoded_path() == "/etc/init.rc") );
Exception Safety

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

Parameters

Name

Description

init

An initializer list of strings.


PrevUpHomeNext