set

Set a value

Synopsis

params_base::iterator
set(
    params_base::iterator pos,
    string_view value);

Declared in file <include/boost/url/params_ref.hpp> on line 848

Defined in file <src/params_ref.cpp> on line 172

Description

This function replaces the value of an element at the specified position. All iterators that are equal to pos or come after are invalidated.

Example

url u( "?id=42&id=69" );

u.params().set( u.params().begin(), "none" );

assert( u.encoded_query() == "id=none&id=69" );

Complexity

Linear in this->url().encoded_query().size().

Exception Safety

Strong guarantee. Calls to allocate may throw.