[#BloombergLP-bdljsn-JsonArray-insert-0e4]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bdljsn.adoc[bdljsn]::xref:BloombergLP/bdljsn/JsonArray.adoc[JsonArray]::insert
:relfileprefix: ../../../
:mrdocs:

`insert` overloads

== Synopses

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

Move&hyphen;insert `json` at the specified `position`&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:BloombergLP/bdljsn/JsonArray/Iterator-0d.adoc[JsonArray::Iterator]
xref:BloombergLP/bdljsn/JsonArray/insert-0e2.adoc[insert](
    xref:BloombergLP/bdljsn/JsonArray/ConstIterator.adoc[ConstIterator] position,
    xref:BloombergLP/bslmf/MovableRef.adoc[bslmf::MovableRef&lt;Json&gt;] json);
----

[.small]#xref:BloombergLP/bdljsn/JsonArray/insert-0e2.adoc[_» more&period;&period;&period;_]#

Insert a copy of `json` at the specified `position`&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:BloombergLP/bdljsn/JsonArray/Iterator-0d.adoc[JsonArray::Iterator]
xref:BloombergLP/bdljsn/JsonArray/insert-0c.adoc[insert](
    xref:BloombergLP/bdljsn/JsonArray/ConstIterator.adoc[ConstIterator] position,
    xref:BloombergLP/bdljsn/Json.adoc[Json] const& json);
----

[.small]#xref:BloombergLP/bdljsn/JsonArray/insert-0c.adoc[_» more&period;&period;&period;_]#

Move&hyphen;insert `json` at the specified `index`&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class t&lowbar;INDEX&gt;
xref:BloombergLP/bdljsn/JsonArray/Iterator-0d.adoc[JsonArray::Iterator]
xref:BloombergLP/bdljsn/JsonArray/insert-01.adoc[insert](
    t&lowbar;INDEX index,
    xref:BloombergLP/bslmf/MovableRef.adoc[bslmf::MovableRef&lt;Json&gt;] json)
requires bsl&colon;&colon;is&lowbar;integral&lt;t&lowbar;INDEX&gt;&colon;&colon;value
                        &amp;&amp; !bsl&colon;&colon;is&lowbar;same&lt;t&lowbar;INDEX, bool&gt;&colon;&colon;value;
----

[.small]#xref:BloombergLP/bdljsn/JsonArray/insert-01.adoc[_» more&period;&period;&period;_]#

Insert a copy of `json` at the specified `index`&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class t&lowbar;INDEX&gt;
xref:BloombergLP/bdljsn/JsonArray/Iterator-0d.adoc[JsonArray::Iterator]
xref:BloombergLP/bdljsn/JsonArray/insert-0a.adoc[insert](
    t&lowbar;INDEX index,
    xref:BloombergLP/bdljsn/Json.adoc[Json] const& json)
requires bsl&colon;&colon;is&lowbar;integral&lt;t&lowbar;INDEX&gt;&colon;&colon;value
                        &amp;&amp; !bsl&colon;&colon;is&lowbar;same&lt;t&lowbar;INDEX, bool&gt;&colon;&colon;value;
----

[.small]#xref:BloombergLP/bdljsn/JsonArray/insert-0a.adoc[_» more&period;&period;&period;_]#

Insert the range `&lsqb;first, last)&rsqb;` at the specified `position`&period;


[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]
xref:BloombergLP/bdljsn/JsonArray/insert-0f.adoc[insert](
    xref:BloombergLP/bdljsn/JsonArray/ConstIterator.adoc[ConstIterator] position,
    t&lowbar;INPUT&lowbar;ITERATOR first,
    t&lowbar;INPUT&lowbar;ITERATOR last);
----

[.small]#xref:BloombergLP/bdljsn/JsonArray/insert-0f.adoc[_» more&period;&period;&period;_]#

Insert the range `&lsqb;first, last)&rsqb;` at the specified `index`&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    class t&lowbar;INDEX,
    class t&lowbar;INPUT&lowbar;ITERATOR&gt;
xref:BloombergLP/bdljsn/JsonArray/Iterator-0d.adoc[JsonArray::Iterator]
xref:BloombergLP/bdljsn/JsonArray/insert-09.adoc[insert](
    t&lowbar;INDEX index,
    t&lowbar;INPUT&lowbar;ITERATOR first,
    t&lowbar;INPUT&lowbar;ITERATOR last)
requires bsl&colon;&colon;is&lowbar;integral&lt;t&lowbar;INDEX&gt;&colon;&colon;value
                        &amp;&amp; !bsl&colon;&colon;is&lowbar;same&lt;t&lowbar;INDEX, bool&gt;&colon;&colon;value;
----

[.small]#xref:BloombergLP/bdljsn/JsonArray/insert-09.adoc[_» more&period;&period;&period;_]#

== Return Value

an iterator referring to the newly inserted element

== Parameters

[cols="1,4"]
|===
| Name| Description
| *position*
| insertion iterator
| *json*
| value to insert
| *index*
| insertion position
| *first*
| beginning of the source range
| *last*
| end of the source range
|===


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