Replace the contents of the container.
template< class FwdIt> void assign( FwdIt first, FwdIt last);
This function replaces the contents with a range of percent-encoded strings.
Each string must contain a valid percent-encoding or else an exception
is thrown. The behavior is undefined if either argument is an iterator
into *this
.
All iterators and references to elements of the container are invalidated,
including the end
iterator.
std::is_convertible< std::iterator_traits< FwdIt >::value_type, string_view >::value == true
url u = parse_relative_uri( "/path/to/file.txt" ); segments_encoded se = u.encoded_segments(); std::vector< std::string > v = { "etc", "init.rc" }; se.insert( u.end() - 1, v.begin(), v.end() ); assert( u.encoded_path() == "/etc/init.rc") );
Strong guarantee. Calls to allocate may throw. Exceptions thrown on invalid input.
Name |
Description |
---|---|
|
An iterator to the first element in the range |
|
An iterator to one past the last element in the range |
Type |
Thrown On |
---|---|
|
invalid percent-encoding |