• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# <small>nlohmann::json_pointer::</small>operator/
2
3```cpp
4// (1)
5json_pointer operator/(const json_pointer& lhs, const json_pointer& rhs);
6
7// (2)
8json_pointer operator/(const json_pointer& lhs, string_t token);
9
10// (3)
11json_pointer operator/(const json_pointer& lhs, std::size_t array_idx);
12```
13
141. create a new JSON pointer by appending the right JSON pointer at the end of the left JSON pointer
152. create a new JSON pointer by appending the unescaped token at the end of the JSON pointer
163. create a new JSON pointer by appending the array-index-token at the end of the JSON pointer
17
18## Parameters
19
20`lhs` (in)
21:    JSON pointer
22
23`rhs` (in)
24:    JSON pointer to append
25
26`token` (in)
27:    reference token to append
28
29`array_idx` (in)
30:    array index to append
31
32## Return value
33
341. a new JSON pointer with `rhs` appended to `lhs`
352. a new JSON pointer with unescaped `token` appended to `lhs`
363. a new JSON pointer with `array_idx` appended to `lhs`
37
38## Complexity
39
401. Linear in the length of `lhs` and `rhs`.
412. Linear in the length of `lhs`.
423. Linear in the length of `lhs`.
43
44## Examples
45
46??? example
47
48    The example shows the usage of `operator/`.
49
50    ```cpp
51    --8<-- "examples/json_pointer__operator_add_binary.cpp"
52    ```
53
54    Output:
55
56    ```json
57    --8<-- "examples/json_pointer__operator_add_binary.output"
58    ```
59
60## Version history
61
621. Added in version 3.6.0.
632. Added in version 3.6.0. Changed type of `token` to `string_t` in version 3.11.0.
643. Added in version 3.6.0.
65