insert overloads

Synopses

Declared in <bdljsn_json.h>

Move‐insert the specified member if its key is not already present.

Insert members from the specified memberInitializers.

JsonObject&
insert(std::initializer_list<JsonObject_MemberInitializer> memberInitializers);

Insert the specified member if its key is not already present.

Insert members from the range [first, last)].

template<class t_INPUT_ITERATOR>
JsonObject&
insert(
    t_INPUT_ITERATOR first,
    t_INPUT_ITERATOR last)
requires !bsl::is_convertible<t_INPUT_ITERATOR, bsl::string_view>::value;

Insert a member constructed from key and value if key is new.

template<class t_VALUE>
bsl::pair<JsonObject::Iterator, bool>
insert(
    std::string_view const& key,
    t_VALUE&& value);

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

Name

Description

member

key/value pair to insert

memberInitializers

initializer‐list of members

first

beginning of the source range

last

end of the source range

key

UTF‐8 member name

value

member value

Created with MrDocs