Sha256: e9cf2681824cd159380a7b1d90778258ad15f9f9b20eb456c749f131bf15d194
Contents?: true
Size: 433 Bytes
Versions: 1
Compression:
Stored size: 433 Bytes
Contents
#include <iostream> #include <iomanip> #include <nlohmann/json.hpp> using json = nlohmann::json; int main() { // create two JSON objects json o1 = R"( {"color": "red", "price": 17.99} )"_json; json o2 = R"( {"color": "blue", "speed": 100} )"_json; // add all keys from o2 to o1 (updating "color") o1.update(o2.begin(), o2.end()); // output updated object o1 std::cout << std::setw(2) << o1 << '\n'; }
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
simdjson-0.3.0 | vendor/simdjson/dependencies/json/doc/examples/update__range.cpp |