return a string representation of the JSON pointer
- Invariant
- For each JSON pointer
ptr
, it holds:
json_pointer(const std::string &s="")
create JSON pointer
- Returns
- a string representation of the JSON pointer
@liveexample{The example shows the result of to_string
.,json_pointer__to_string}
- Since
- version 2.0.0
Definition at line 12609 of file json.hpp.
12610 {
12611 return std::accumulate(reference_tokens.begin(), reference_tokens.end(),
12612 std::string{},
12613 [](const std::string & a, const std::string & b)
12614 {
12615 return a + "/" + detail::escape(b);
12616 });
12617 }