Insert a range of segments.
iterator insert( iterator before, std::initializer_list< string_view > init);
This function inserts a range of percent-encoded strings passed as an
initializer-list. Each string must contain a valid percent-encoding or
else an exception is thrown. All references and iterators starting from
the newly inserted elements and up to and including the last element
and end
iterators are invalidated.
url u = parse_relative_uri( "/path/file.txt" ); segments_encoded se = u.encoded_segments(); se.insert( u.end() - 1, { "to", "the" } ); assert( u.encoded_path() == "/path/to/the/file.txt") );
Behavior is undefined if any elements of the initializer_list belong to the container
Strong guarantee. Calls to allocate may throw. Exceptions thrown on invalid input.
An iterator to one past the last newly inserted element or before
if the range is empty.
Name |
Description |
---|---|
|
An iterator before which the new elements should be inserted. |
|
The initializer list containing percent-encoded segments to insert. |
Type |
Thrown On |
---|---|
|
invalid percent-encoding |