]> git.proxmox.com Git - ceph.git/blob - ceph/src/jaegertracing/opentelemetry-cpp/third_party/nlohmann-json/doc/examples/erase__key_type.cpp
update ceph source to reef 18.1.2
[ceph.git] / ceph / src / jaegertracing / opentelemetry-cpp / third_party / nlohmann-json / doc / examples / erase__key_type.cpp
1 #include <iostream>
2 #include <nlohmann/json.hpp>
3
4 using json = nlohmann::json;
5
6 int main()
7 {
8 // create a JSON object
9 json j_object = {{"one", 1}, {"two", 2}};
10
11 // call erase()
12 auto count_one = j_object.erase("one");
13 auto count_three = j_object.erase("three");
14
15 // print values
16 std::cout << j_object << '\n';
17 std::cout << count_one << " " << count_three << '\n';
18 }