! @brief return a string representation of the JSON pointer @invariant For each JSON pointer `ptr`, it holds: @code {.cpp} ptr == json_pointer(ptr.to_string()); @endcode @return 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
| 11596 | @since version 2.0.0 |
| 11597 | */ |
| 11598 | std::string to_string() const |
| 11599 | { |
| 11600 | return std::accumulate(reference_tokens.begin(), reference_tokens.end(), |
| 11601 | std::string{}, |
| 11602 | [](const std::string& a, const std::string& b) |
| 11603 | { |
| 11604 | return a + "/" + escape(b); |
| 11605 | }); |
| 11606 | } |
| 11607 | |
| 11608 | /// @copydoc to_string() |
| 11609 | operator std::string() const |