:relfileprefix: ../../../
[#boost-urls-params_ref-set-09]

== xref:boost.adoc[pass:[boost]]::xref:boost/urls.adoc[pass:[urls]]::xref:boost/urls/params_ref.adoc[pass:[params_ref]]::set


Set a value


=== Synopsis

Declared in header `<https://www.github.com/boostorg/url/blob/develop/include/boost/url/params_ref.hpp#L848[boost/url/params_ref.hpp,window=blank_]>`

[source,cpp,subs="verbatim,macros,-callouts"]
----
xref:boost/urls/params_base/iterator.adoc[iterator]
set(
    xref:boost/urls/params_base/iterator.adoc[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.
[,cpp]
----
url u( "?id=42&id=69" );

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

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

=== Linear in `this-&gt;url().encoded_query().size()`.

=== 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.

|===




