[#boost-urls-params_ref-insert-05]
= xref:boost.adoc[boost]::xref:boost/urls.adoc[urls]::xref:boost/urls/params_ref.adoc[params&lowbar;ref]::insert
:relfileprefix: ../../../
:mrdocs:


Insert elements

== Synopsis


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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class FwdIt&gt;
xref:boost/urls/params_base/iterator.adoc[iterator]
insert(
    xref:boost/urls/params_base/iterator.adoc[iterator] before,
    FwdIt first,
    FwdIt last);
----

== Description


This function inserts a range of        params 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;


=== Mandates

[,cpp]
----
std::is_convertible< std::iterator_traits< FwdIt >::reference_type, param_view >::value == true
----

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



== Return Value


An iterator to the first        element inserted, or `before` if        `first &equals;&equals; last`&period;



== Parameters


|===
| Name | Description

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


| *first,*
| last The range of params        to insert&period;


|===



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