[#boost-urls-params_encoded_ref-insert-03]
= 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#L471[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,
    xref:boost/urls/param_pct_view.adoc[param&lowbar;pct&lowbar;view] const& p);
----

== Description


This function inserts a param        before the specified position&period;

All iterators that are equal to        `before` or come after are invalidated&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


|===
| Name | Thrown on

| `system&lowbar;error`
| `p` contains an invalid percent&hyphen;encoding&period;


|===

== Return Value


An iterator to the inserted        element&period;



== Parameters


|===
| Name | Description

| *before*
| An iterator before which        the param is inserted&period; This may        be equal to `end()`&period;


| *p*
| The param to insert&period;


|===



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