Skip to content

Commit 8c391e0

Browse files
Docs: Fix wrong code usage in the Value access section of json_pointer.md (#4255)
1 parent 01da82e commit 8c391e0

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

docs/mkdocs/docs/features/json_pointer.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,10 +71,10 @@ auto j = json::parse(R"({
7171
})");
7272

7373
// access values
74-
auto val = j["/"_json_pointer]; // {"array":["A","B","C"],...}
74+
auto val = j[""_json_pointer]; // {"array":["A","B","C"],...}
7575
auto val1 = j["/nested/one"_json_pointer]; // 1
76-
auto val2 = j.at[json::json_pointer("/nested/three/1")]; // false
77-
auto val3 = j.value[json::json_pointer("/nested/four", 0)]; // 0
76+
auto val2 = j.at(json::json_pointer("/nested/three/1")); // false
77+
auto val3 = j.value(json::json_pointer("/nested/four"), 0); // 0
7878
```
7979

8080
## Flatten / unflatten

0 commit comments

Comments
 (0)