]> git.proxmox.com Git - ceph.git/blob - ceph/src/jaegertracing/opentelemetry-cpp/third_party/nlohmann-json/doc/examples/json_pointer__operator_add.cpp
update ceph source to reef 18.1.2
[ceph.git] / ceph / src / jaegertracing / opentelemetry-cpp / third_party / nlohmann-json / doc / examples / json_pointer__operator_add.cpp
1 #include <iostream>
2 #include <nlohmann/json.hpp>
3
4 using json = nlohmann::json;
5
6 int main()
7 {
8 // create a JSON pointer
9 json::json_pointer ptr("/foo");
10 std::cout << ptr << '\n';
11
12 // append a JSON Pointer
13 ptr /= json::json_pointer("/bar/baz");
14 std::cout << ptr << '\n';
15
16 // append a string
17 ptr /= "fob";
18 std::cout << ptr << '\n';
19
20 // append an array index
21 ptr /= 42;
22 std::cout << ptr << std::endl;
23 }