[#BloombergLP-bdljsn-Json-insert-02]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bdljsn.adoc[bdljsn]::xref:BloombergLP/bdljsn/Json.adoc[Json]::insert
:relfileprefix: ../../../
:mrdocs:

Insert into the `JsonArray` held by this object at the specified `position` the values in the range `&lsqb;first, last)&rsqb;`, and return an iterator referring to the first newly inserted element&period; If an exception is thrown, `&ast;this` is unaffected&period; Throw `bsl&colon;&colon;length&lowbar;error` if `size() &plus; distance(first, last) &gt; maxSize()`&period; The behavior is undefined unless `isArray()` and `position` is in the range `&lsqb;theArray()&period;begin() &period;&period; theArray()&period;end()&rsqb;`&period;

== Synopsis

Declared in `&lt;bdljsn&lowbar;json&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class t&lowbar;INPUT&lowbar;ITERATOR&gt;
xref:BloombergLP/bdljsn/JsonArray/Iterator-0d.adoc[JsonArray::Iterator]
insert(
    xref:BloombergLP/bdljsn/JsonArray/ConstIterator.adoc[JsonArray::ConstIterator] position,
    t&lowbar;INPUT&lowbar;ITERATOR first,
    t&lowbar;INPUT&lowbar;ITERATOR last);
----


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