]>
git.proxmox.com Git - ceph.git/blob - ceph/src/jaegertracing/opentelemetry-cpp/third_party/nlohmann-json/doc/examples/clear.cpp
2 #include <nlohmann/json.hpp>
4 using json
= nlohmann::json
;
10 json j_boolean
= true;
11 json j_number_integer
= 17;
12 json j_number_float
= 23.42;
13 json j_object
= {{"one", 1}, {"two", 2}};
14 json j_array
= {1, 2, 4, 8, 16};
15 json j_string
= "Hello, world";
20 j_number_integer
.clear();
21 j_number_float
.clear();
26 // serialize the cleared values()
27 std::cout
<< j_null
<< '\n';
28 std::cout
<< j_boolean
<< '\n';
29 std::cout
<< j_number_integer
<< '\n';
30 std::cout
<< j_number_float
<< '\n';
31 std::cout
<< j_object
<< '\n';
32 std::cout
<< j_array
<< '\n';
33 std::cout
<< j_string
<< '\n';