[#nlohmann-basic_json-0c-insert-0f]
= xref:nlohmann.adoc[nlohmann]::xref:nlohmann/basic_json-0c.adoc[basic&lowbar;json]::insert
:relfileprefix: ../../
:mrdocs:

inserts copies of element into array

== Synopsis

Declared in `&lt;nlohmann&sol;json&period;hpp&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:nlohmann/basic_json-0c/iterator.adoc[iterator]
insert(
    xref:nlohmann/basic_json-0c/const_iterator.adoc[const&lowbar;iterator] pos,
    xref:nlohmann/basic_json-0c/size_type.adoc[size&lowbar;type] cnt,
    xref:nlohmann/basic_json-0c.adoc[basic&lowbar;json] const& val);
----

== Return Value

iterator pointing to the first element inserted, or _pos_ if _cnt_ is `0`

== Parameters

[cols="1,4"]
|===
| Name| Description
| *pos*
| iterator before which the elements will be inserted
| *cnt*
| number of copies to insert
| *val*
| element to insert
|===


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