mirror of
https://github.com/nlohmann/json.git
synced 2025-07-16 18:41:53 +03:00
Adjust JSON Pointer examples (#3622)
* 📝 adjust JSON Pointer examples * 👷 add test for documentation * 📝 note platform-dependent output on some examples
This commit is contained in:
@ -9,11 +9,11 @@ int main()
|
||||
json::json_pointer ptr("/foo");
|
||||
|
||||
// append a JSON Pointer
|
||||
std::cout << ptr / json::json_pointer("/bar/baz") << '\n';
|
||||
std::cout << "\"" << ptr / json::json_pointer("/bar/baz") << "\"\n";
|
||||
|
||||
// append a string
|
||||
std::cout << ptr / "fob" << '\n';
|
||||
std::cout << "\"" << ptr / "fob" << "\"\n";
|
||||
|
||||
// append an array index
|
||||
std::cout << ptr / 42 << std::endl;
|
||||
std::cout << "\"" << ptr / 42 << "\"" << std::endl;
|
||||
}
|
||||
|
Reference in New Issue
Block a user