]>
git.proxmox.com Git - ceph.git/blob - ceph/src/jaegertracing/opentelemetry-cpp/third_party/nlohmann-json/doc/examples/std_hash.cpp
3 #include <nlohmann/json.hpp>
5 using json
= nlohmann::json
;
9 std::cout
<< "hash(null) = " << std::hash
<json
> {}(json(nullptr)) << '\n'
10 << "hash(false) = " << std::hash
<json
> {}(json(false)) << '\n'
11 << "hash(0) = " << std::hash
<json
> {}(json(0)) << '\n'
12 << "hash(0U) = " << std::hash
<json
> {}(json(0U)) << '\n'
13 << "hash(\"\") = " << std::hash
<json
> {}(json("")) << '\n'
14 << "hash({}) = " << std::hash
<json
> {}(json::object()) << '\n'
15 << "hash([]) = " << std::hash
<json
> {}(json::array()) << '\n'
16 << "hash({\"hello\": \"world\"}) = " << std::hash
<json
> {}("{\"hello\": \"world\"}"_json
)