]> git.proxmox.com Git - ceph.git/blob - ceph/src/jaegertracing/opentelemetry-cpp/third_party/nlohmann-json/doc/examples/std_hash.cpp
update ceph source to reef 18.1.2
[ceph.git] / ceph / src / jaegertracing / opentelemetry-cpp / third_party / nlohmann-json / doc / examples / std_hash.cpp
1 #include <iostream>
2 #include <iomanip>
3 #include <nlohmann/json.hpp>
4
5 using json = nlohmann::json;
6
7 int main()
8 {
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)
17 << std::endl;
18 }