JSON for Modern C++  3.0.1

◆ operator std::string()

nlohmann::json_pointer::operator std::string ( ) const
inline
Invariant
For each JSON pointer ptr, it holds:
ptr == json_pointer(ptr.to_string());
Returns
a string representation of the JSON pointer
Example The example shows the result of to_string.
json_pointer__to_string.cpp
Output (play with this example online):
/foo
/foo/0
/
/a~1b
/c%d
/e^f
/g|h
/i\j
/k"l
/ 
/m~0n

The <a href= https://github.com/nlohmann/json/blob/develop/doc/examples/ json_pointer__to_string.cpp>example code above can be translated with
g++ -std=c++11 -Isrc doc/examples/
json_pointer__to_string.cpp -o 
json_pointer__to_string 
Since
version 2.0.0

Definition at line 7015 of file json.hpp.