]>
git.proxmox.com Git - ceph.git/blob - ceph/src/jaegertracing/opentelemetry-cpp/third_party/nlohmann-json/doc/examples/operator__greater.cpp
2 #include <nlohmann/json.hpp>
4 using json
= nlohmann::json
;
8 // create several JSON values
9 json array_1
= {1, 2, 3};
10 json array_2
= {1, 2, 4};
11 json object_1
= {{"A", "a"}, {"B", "b"}};
12 json object_2
= {{"B", "b"}, {"A", "a"}};
14 json number_2
= 17.0000000000001L;
15 json string_1
= "foo";
16 json string_2
= "bar";
18 // output values and comparisons
19 std::cout
<< std::boolalpha
;
20 std::cout
<< array_1
<< " > " << array_2
<< " " << (array_1
> array_2
) << '\n';
21 std::cout
<< object_1
<< " > " << object_2
<< " " << (object_1
> object_2
) << '\n';
22 std::cout
<< number_1
<< " > " << number_2
<< " " << (number_1
> number_2
) << '\n';
23 std::cout
<< string_1
<< " > " << string_2
<< " " << (string_1
> string_2
) << '\n';