Insert a range of segments.
iterator insert( iterator before, std::initializer_list< string_view > init);
This function inserts a range of unencoded strings passed as an initializer-list.
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 se = u.segments(); se.insert( u.end() - 1, { "to", "the" } ); assert( u.encoded_path() == "/path/to/the/file.txt") );
Strong guarantee. Calls to allocate may throw.
Behavior is undefined if any elements of initializer_list belong to the container
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 unencoded segments to insert. |