[#boost-urls-params_encoded_ref-insert-0b]
= xref:boost.adoc[boost]::xref:boost/urls.adoc[urls]::xref:boost/urls/params_encoded_ref.adoc[params&lowbar;encoded&lowbar;ref]::insert
:relfileprefix: ../../../
:mrdocs:

Insert params

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:boost/urls/params_encoded_base/iterator.adoc[iterator]
insert(
    xref:boost/urls/params_encoded_base/iterator.adoc[iterator] before,
    std::initializer&lowbar;list&lt;param&lowbar;pct&lowbar;view&gt; init);
----

== Description

This function inserts the params in an _initializer&hyphen;list_ before the specified position&period;

All iterators that are equal to `before` or come after are invalidated&period;

[NOTE]
The strings referenced by the inputs must not come from the underlying url, or else the behavior is undefined&period;

== Complexity
Linear in `this&hyphen;&gt;url()&period;encoded&lowbar;query()&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

An iterator to the first element inserted, or `before` if `init&period;size() &equals;&equals; 0`&period;

== Parameters

[cols=2]
|===
| Name
| Description
| *before*
| An iterator before which the element is inserted&period; This may be equal to `end()`&period;
| *init*
| The list of params to insert&period;
|===


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