Replace the contents of the container.
segments_encoded& operator=( std::initializer_list< string_view > init);
This function replaces the contents with an initializer list of percent-encoded
strings. Each string must contain a valid percent-encoding or else an
exception is thrown. The behavior is undefined any string refers to the
contents of *this
.
All iterators and references to elements of the container are invalidated,
including the end
iterator.
url u = parse_relative_uri( "/path/to/file.txt" ); u.encoded_segments() = { "etc", "init.rc" }; assert( u.encoded_path() == "/etc/init.rc") );
Strong guarantee. Calls to allocate may throw. Exceptions thrown on invalid input.
Name |
Description |
---|---|
|
An initializer list of strings. |
Type |
Thrown On |
---|---|
|
invalid percent-encoding |