diff --git a/include/nlohmann/json.hpp b/include/nlohmann/json.hpp index 49188b314..1a194e8b7 100644 --- a/include/nlohmann/json.hpp +++ b/include/nlohmann/json.hpp @@ -5074,6 +5074,22 @@ std::string to_string(const NLOHMANN_BASIC_JSON_TPL& j) return j.dump(); } +inline nlohmann::json operator+(const nlohmann::json& lhs, const nlohmann::json& rhs) +{ + nlohmann::json ret; + for (const auto& el : lhs.items()) + { + ret[el.key()] = el.value(); + } + + for (const auto& el : rhs.items()) + { + ret[el.key()] = el.value(); + } + + return ret; +} + inline namespace literals { inline namespace json_literals