mirror of
https://github.com/nlohmann/json.git
synced 2024-11-23 22:19:02 +08:00
doc: Fix JSON Pointer example to use direct initialization
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.
This commit is contained in:
parent
b36f4c477c
commit
371ee4bc26
@ -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:
|
||||
|
||||
```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:
|
||||
|
Loading…
Reference in New Issue
Block a user