1 #include <iostream> 2 #include <nlohmann/json.hpp> 3 4 using json = nlohmann::json; 5 main()6int 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 } 24