1
0
mirror of https://github.com/nlohmann/json.git synced 2025-08-06 07:02:42 +03:00

doc: Fix JSON Pointer example to use direct initialization (#4468)

Changed the example code in the documentation from copy initialization
to direct initialization for `json::json_pointer`.
This prevents compilation errors caused by the constructor being explicit.

Signed-off-by: Niels Lohmann <mail@nlohmann.me>
This commit is contained in:
Kuan-Fu, Wu
2025-05-22 18:39:39 +08:00
committed by Niels Lohmann
parent c4c1820c47
commit 39c59b89be

View File

@@ -42,7 +42,7 @@ Note `/` does not identify the root (i.e., the whole document), but an object en
JSON Pointers can be created from a string: JSON Pointers can be created from a string:
```cpp ```cpp
json::json_pointer p = "/nested/one"; json::json_pointer p("/nested/one");
``` ```
Furthermore, a user-defined string literal can be used to achieve the same result: Furthermore, a user-defined string literal can be used to achieve the same result: