// (1) void update(const_reference j); // (2) void update(const_iterator first, const_iterator last);
j
and overwrites existing keys.[first, last)
and overwrites existing keys.The function is motivated by Python's dict.update function.
j
(in) : JSON object to read values from
first
(in) : begin of the range of elements to insert
last
(in) : end of the range of elements to insert
type_error.312
if called on JSON values other than objects; example: "cannot use update() with string"
type_error.312
if called on JSON values other than objects; example: "cannot use update() with string"
invalid_iterator.202
if called on an iterator which does not belong to the current JSON value; example: "iterator does not fit current value"
invalid_iterator.210
if first
and last
do not belong to the same JSON value; example: "iterators do not fit"
??? example
The example shows how `update()` is used. ```cpp --8<-- "examples/update.cpp" ``` Output: ```json --8<-- "examples/update.output" ```
??? example
The example shows how `update()` is used. ```cpp --8<-- "examples/update__range.cpp" ``` Output: ```json --8<-- "examples/update__range.output" ```