diff --git a/include/nlohmann/json.hpp b/include/nlohmann/json.hpp index 536d71f74..19fc9da39 100644 --- a/include/nlohmann/json.hpp +++ b/include/nlohmann/json.hpp @@ -3158,14 +3158,14 @@ class basic_json // NOLINT(cppcoreguidelines-special-member-functions,hicpp-spec /// @brief updates a JSON object from another object, overwriting existing keys /// @sa https://json.nlohmann.me/api/basic_json/update/ - void update(const_reference j) + void update(const_reference j, bool merge_objects = false) { update(j.begin(), j.end(), merge_objects); } /// @brief updates a JSON object from another object, overwriting existing keys /// @sa https://json.nlohmann.me/api/basic_json/update/ - void update(const_iterator first, const_iterator last) + void update(const_iterator first, const_iterator last, bool merge_objects = false) { // implicitly convert null value to an empty object if (is_null()) diff --git a/single_include/nlohmann/json.hpp b/single_include/nlohmann/json.hpp index f0792b0df..3b7d86671 100644 --- a/single_include/nlohmann/json.hpp +++ b/single_include/nlohmann/json.hpp @@ -20659,14 +20659,14 @@ class basic_json // NOLINT(cppcoreguidelines-special-member-functions,hicpp-spec /// @brief updates a JSON object from another object, overwriting existing keys /// @sa https://json.nlohmann.me/api/basic_json/update/ - void update(const_reference j) + void update(const_reference j, bool merge_objects = false) { update(j.begin(), j.end(), merge_objects); } /// @brief updates a JSON object from another object, overwriting existing keys /// @sa https://json.nlohmann.me/api/basic_json/update/ - void update(const_iterator first, const_iterator last) + void update(const_iterator first, const_iterator last, bool merge_objects = false) { // implicitly convert null value to an empty object if (is_null())