]> git.proxmox.com Git - ceph.git/blob - ceph/src/jaegertracing/opentelemetry-cpp/third_party/nlohmann-json/doc/examples/crend.cpp
update ceph source to reef 18.1.2
[ceph.git] / ceph / src / jaegertracing / opentelemetry-cpp / third_party / nlohmann-json / doc / examples / crend.cpp
1 #include <iostream>
2 #include <nlohmann/json.hpp>
3
4 using json = nlohmann::json;
5
6 int main()
7 {
8 // create an array value
9 json array = {1, 2, 3, 4, 5};
10
11 // get an iterator to the reverse-end
12 json::const_reverse_iterator it = array.crend();
13
14 // increment the iterator to point to the first element
15 --it;
16
17 // serialize the element that the iterator points to
18 std::cout << *it << '\n';
19 }