[#BloombergLP-bdljsn-JsonObject-insert-032]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bdljsn.adoc[bdljsn]::xref:BloombergLP/bdljsn/JsonObject.adoc[JsonObject]::insert
:relfileprefix: ../../../
:mrdocs:

`insert` overloads

== Synopses

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

Move&hyphen;insert the specified `member` if its key is not already present&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:bsl/pair-0b.adoc[bsl::pair&lt;JsonObject::Iterator, bool&gt;]
xref:BloombergLP/bdljsn/JsonObject/insert-05.adoc[insert](xref:BloombergLP/bslmf/MovableRef.adoc[bslmf::MovableRef&lt;Member&gt;] member);
----

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

Insert members from the specified `memberInitializers`&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:BloombergLP/bdljsn/JsonObject.adoc[JsonObject]&
xref:BloombergLP/bdljsn/JsonObject/insert-031.adoc[insert](std::initializer&lowbar;list&lt;JsonObject&lowbar;MemberInitializer&gt; memberInitializers);
----

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

Insert the specified `member` if its key is not already present&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:bsl/pair-0b.adoc[bsl::pair&lt;JsonObject::Iterator, bool&gt;]
xref:BloombergLP/bdljsn/JsonObject/insert-0d.adoc[insert](xref:BloombergLP/bdljsn/JsonObject/Member.adoc[Member] const& member);
----

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

Insert members from the range `&lsqb;first, last)&rsqb;`&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class t&lowbar;INPUT&lowbar;ITERATOR&gt;
xref:BloombergLP/bdljsn/JsonObject.adoc[JsonObject]&
xref:BloombergLP/bdljsn/JsonObject/insert-0b.adoc[insert](
    t&lowbar;INPUT&lowbar;ITERATOR first,
    t&lowbar;INPUT&lowbar;ITERATOR last)
requires !bsl&colon;&colon;is&lowbar;convertible&lt;t&lowbar;INPUT&lowbar;ITERATOR, bsl&colon;&colon;string&lowbar;view&gt;&colon;&colon;value;
----

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

Insert a member constructed from `key` and `value` if `key` is new&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class t&lowbar;VALUE&gt;
xref:bsl/pair-0b.adoc[bsl::pair&lt;JsonObject::Iterator, bool&gt;]
xref:BloombergLP/bdljsn/JsonObject/insert-01.adoc[insert](
    std::string&lowbar;view const& key,
    t&lowbar;VALUE&& value);
----

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

== Return Value

* a pair of an iterator to the element and a `bool` that is `true` if inserted
* an iterator referring to the newly inserted element
* a reference providing modifiable access to this object

== Parameters

[cols="1,4"]
|===
| Name| Description
| *member*
| key&sol;value pair to insert
| *memberInitializers*
| initializer&hyphen;list of members
| *first*
| beginning of the source range
| *last*
| end of the source range
| *key*
| UTF&hyphen;8 member name
| *value*
| member value
|===


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