1#include <iostream>
2#include <nlohmann/json.hpp>
3
4using json = nlohmann::json;
5
6int main()
7{
8    // different JSON Pointers
9    json::json_pointer ptr0;
10    json::json_pointer ptr1("");
11    json::json_pointer ptr2("/foo");
12    json::json_pointer ptr3("/foo/0");
13
14    // call empty()
15    std::cout << std::boolalpha
16              << "\"" << ptr0 << "\": " << ptr0.empty() << '\n'
17              << "\"" << ptr1 << "\": " << ptr1.empty() << '\n'
18              << "\"" << ptr2 << "\": " << ptr2.empty() << '\n'
19              << "\"" << ptr3 << "\": " << ptr3.empty() << std::endl;
20}
21