[#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 `<bdljsn_json.h>` Insert the specified `member` into this `JsonObject` if the key (the `first` element) of the object referred to by `member` does not already exist in this `JsonObject`; otherwise, this method has no effect. Return a `pair` whose `first` member is an iterator referring to the (possibly newly inserted) `member` object in this `JsonObject` whose key is the equivalent to that of the object to be inserted, and whose `second` member is `true` if a new value was inserted, and `false` otherwise. The behavior is undefined unless `member.first` is valid UTF‐8 (see `bdlde::Utf8Util::isValid`). [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- xref:bsl/pair-0b.adoc[bsl::pair<JsonObject::Iterator, bool>] xref:BloombergLP/bdljsn/JsonObject/insert-05.adoc[insert](xref:BloombergLP/bslmf/MovableRef.adoc[bslmf::MovableRef<Member>] member); ---- [.small]#xref:BloombergLP/bdljsn/JsonObject/insert-05.adoc[_» more..._]# Insert into this `JsonObject` members created (in order) from the specified `members`. List members having key values already contained in this object are ignored. Return a non‐`const` reference to this `JsonObject`. The behavior is undefined unless the keys of all `Member` objects inserted are valid UTF‐8 (see `bdlde::Utf8Util::isValid`). [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- xref:BloombergLP/bdljsn/JsonObject.adoc[JsonObject]& xref:BloombergLP/bdljsn/JsonObject/insert-031.adoc[insert](std::initializer_list<JsonObject_MemberInitializer> memberInitializers); ---- [.small]#xref:BloombergLP/bdljsn/JsonObject/insert-031.adoc[_» more..._]# Insert the specified `member` into this `JsonObject` if the key (the `first` element) of the object referred to by `value` does not already exist in this `JsonObject`; otherwise, this method has no effect. Return a `pair` whose `first` member is an iterator referring to the (possibly newly inserted) `value_type` object in this `JsonObject` whose key is equivalent to that of the object to be inserted, and whose `second` member is `true` if a new value was inserted, and `false` if a value having an equivalent key was already present. The behavior is undefined unless `member.first` is valid UTF‐8 (see `bdlde::Utf8Util::isValid`). [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- xref:bsl/pair-0b.adoc[bsl::pair<JsonObject::Iterator, bool>] 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..._]# Create a `Member` object for each iterator in the range starting at the specified `first` iterator and ending immediately before the specified `last` iterator, by converting from the object referred to by each iterator. Insert into this `JsonObject` each such object whose key is not already contained. Return a non‐`const` reference to this `JsonObject`. The (template parameter) type `t_INPUT_ITERATOR` shall meet the requirements of an input iterator defined in the C++11 standard [24.2.3]providing access to values of a type convertible to `Member`. The behavior is undefined unless `first` and `last` refer to a sequence of value values where `first` is at a position at or before `last`. The behavior is undefined unless the keys of all `Member` objects inserted are valid UTF‐8 (see `bdlde::Utf8Util::isValid`). [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class t_INPUT_ITERATOR> xref:BloombergLP/bdljsn/JsonObject.adoc[JsonObject]& xref:BloombergLP/bdljsn/JsonObject/insert-0b.adoc[insert]( t_INPUT_ITERATOR first, t_INPUT_ITERATOR last) requires !bsl::is_convertible<t_INPUT_ITERATOR, bsl::string_view>::value; ---- [.small]#xref:BloombergLP/bdljsn/JsonObject/insert-0b.adoc[_» more..._]# Insert into this `JsonObject` a `Member` constructed from the specified `key` and the specified `value`, respectively, if `key` does not already exist in this `JsonObject`; otherwise, this method has no effect. Return a `pair` whose `first` member is an iterator referring to the (possibly newly inserted) `Member` object in this `JsonObject` whose key is the equivalent to that of the object to be inserted, and whose `second` member is `true` if a new value was inserted, and `false` otherwise. The behavior is undefined unless `key` is valid UTF‐8 (see `bdlde::Utf8Util::isValid`). [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class t_VALUE> xref:bsl/pair-0b.adoc[bsl::pair<JsonObject::Iterator, bool>] xref:BloombergLP/bdljsn/JsonObject/insert-01.adoc[insert]( std::string_view const& key, t_VALUE&& value); ---- [.small]#xref:BloombergLP/bdljsn/JsonObject/insert-01.adoc[_» more..._]# [.small]#Created with https://www.mrdocs.com[MrDocs]#