|
◆ operator/ [1/3]
template<typename BasicJsonType >
- Parameters
-
[in] | lhs | JSON pointer |
[in] | rhs | JSON pointer |
- Returns
- a new JSON pointer with rhs appended to lhs
- Example
- The example shows the usage of
operator/ .
2 #include <nlohmann/json.hpp>
15 std::cout << ptr / "fob" << '\n';
18 std::cout << ptr / 42 << std::endl;
::nlohmann::json_pointer< basic_json > json_pointer JSON Pointer, see nlohmann::json_pointer.
basic_json<> json default JSON class
Output (play with this example online): "/foo/bar/baz"
"/foo/fob"
"/foo/42"
The example code above can be translated withg++ -std=c++11 -Isingle_include doc/examples/json_pointer__operator_add_binary.cpp -o json_pointer__operator_add_binary
- Complexity
- Linear in the length of lhs and rhs.
- See also
- see operator/=(const json_pointer&) to append a JSON pointer
- Since
- version 3.6.0
Definition at line 12502 of file json.hpp.
|