[#boost-urls-params_encoded_ref-operator_assign-03]
= xref:boost/urls/params_encoded_ref/operator_assign-03.adoc[boost::urls::params&lowbar;encoded&lowbar;ref::operator&equals;]
:relfileprefix: ../../../
:mrdocs:

Assignment

== Synopsis

Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/params_encoded_ref.hpp#L181[boost&sol;url&sol;params&lowbar;encoded&lowbar;ref&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:boost/urls/params_encoded_ref.adoc[params&lowbar;encoded&lowbar;ref]&
operator&equals;(std::initializer&lowbar;list&lt;param&lowbar;pct&lowbar;view&gt; init);
----

== Description

After assignment, the previous contents of the query parameters are replaced by the contents of the initializer&hyphen;list&period;

All iterators are invalidated&period;

== Preconditions
None of character buffers referenced by `init` may overlap the character buffer of the underlying url, or else the behavior is undefined&period;

== Effects
[,cpp]
----
this->assign( init.begin(), init.end() );
----
== Complexity
Linear in `init&period;size()`&period;

== Exception Safety
Strong guarantee&period; Calls to allocate may throw&period; Exceptions thrown on invalid input&period;

== Exceptions

[cols=2]
|===
| Name
| Thrown on
| `system&lowbar;error`
| `init` contains an invalid percent&hyphen;encoding&period;
|===

== Return Value

`&ast;this`

== Parameters

[cols=2]
|===
| Name
| Description
| *init*
| The list of params to assign&period;
|===


[.small]#Created with https://www.mrdocs.com[MrDocs]#
