]> git.proxmox.com Git - ceph.git/blob - ceph/src/jaegertracing/opentelemetry-cpp/third_party/nlohmann-json/doc/examples/insert__range_object.cpp
update ceph source to reef 18.1.2
[ceph.git] / ceph / src / jaegertracing / opentelemetry-cpp / third_party / nlohmann-json / doc / examples / insert__range_object.cpp
1 #include <iostream>
2 #include <nlohmann/json.hpp>
3
4 using json = nlohmann::json;
5
6 int main()
7 {
8 // create two JSON objects
9 json j1 = {{"one", "eins"}, {"two", "zwei"}};
10 json j2 = {{"eleven", "elf"}, {"seventeen", "siebzehn"}};
11
12 // output objects
13 std::cout << j1 << '\n';
14 std::cout << j2 << '\n';
15
16 // insert range from j2 to j1
17 j1.insert(j2.begin(), j2.end());
18
19 // output result of insert call
20 std::cout << j1 << '\n';
21 }