Boost C++ Libraries

...one of the most highly regarded and expertly designed C++ library projects in the world. Herb Sutter and Andrei Alexandrescu, C++ Coding Standards

This is the documentation for an old version of Boost. Click here to view this page for the latest version.
PrevUpHomeNext
params_ref::set (1 of 2 overloads)

Set a value.

Synopsis
iterator
set(
    iterator pos,
    core::string_view value);
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.

Return Value

An iterator to the element.

Parameters

Name

Description

pos

An iterator to the element.

value

The value to assign. The empty string still counts as a value. That is, has_value for the element is true.


PrevUpHomeNext