insert overloads
Synopses
Declared in <bdljsn_json.h>
Move‐insert member into the held object if its key is new.
Insert members from memberInitializers into the held object.
Insert member into the held object if its key is new.
bsl::pair<JsonObject::Iterator, bool>
insert(JsonObject::Member const& member);
Move‐insert json at position in the held array.
JsonArray::Iterator
insert(
JsonArray::ConstIterator position,
bslmf::MovableRef<Json> json);
Insert a copy of json at position in the held array.
JsonArray::Iterator
insert(
JsonArray::ConstIterator position,
Json const& json);
Move‐insert json at index in the held array.
template<class t_INDEX>
JsonArray::Iterator
insert(
t_INDEX index,
bslmf::MovableRef<Json> json)
requires bsl::is_integral<t_INDEX>::value
&& !bsl::is_same<t_INDEX, bool>::value;
Insert a copy of json at index in the held array.
template<class t_INDEX>
JsonArray::Iterator
insert(
t_INDEX index,
Json const& json)
requires bsl::is_integral<t_INDEX>::value
&& !bsl::is_same<t_INDEX, bool>::value;
Insert members from [first, last)] into the held object.
Insert a member from key and value into the held object if new.
template<
class t_VALUE,
class t_STRING_VIEW>
bsl::pair<JsonObject::Iterator, bool>
insert(
t_STRING_VIEW const& key,
t_VALUE&& value)
requires !bsl::is_integral <t_STRING_VIEW>::value
&& bsl::is_convertible<t_STRING_VIEW,
bsl::string_view>::value;
Insert [first, last)] at position in the held array.
template<class t_INPUT_ITERATOR>
JsonArray::Iterator
insert(
JsonArray::ConstIterator position,
t_INPUT_ITERATOR first,
t_INPUT_ITERATOR last);
Insert [first, last)] at index in the held array.
template<
class t_INDEX,
class t_INPUT_ITERATOR>
JsonArray::Iterator
insert(
t_INDEX index,
t_INPUT_ITERATOR first,
t_INPUT_ITERATOR last)
requires bsl::is_integral<t_INDEX>::value
&& !bsl::is_same<t_INDEX, bool>::value;
Return Value
-
a pair of an iterator to the element and a
boolthat istrueif inserted -
a reference providing modifiable access to this object
-
an iterator referring to the newly inserted element
-
a pair of an iterator to the element and a
boolthat istrueif a new member was inserted
Parameters
Name |
Description |
member |
key/value pair to insert |
memberInitializers |
initializer‐list of members |
position |
insertion iterator |
json |
value to insert |
index |
insertion position |
first |
beginning of the source range |
last |
end of the source range |
key |
UTF‐8 member name |
value |
member value |
Created with MrDocs