Skip to content

Commit

Permalink
Docs: Fix wrong code usage in the Value access section of `json_point…
Browse files Browse the repository at this point in the history
…er.md` (#4255)
  • Loading branch information
Fallen-Breath committed Apr 13, 2024
1 parent 01da82e commit 8c391e0
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions docs/mkdocs/docs/features/json_pointer.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,10 @@ auto j = json::parse(R"({
})");

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

## Flatten / unflatten
Expand Down

0 comments on commit 8c391e0

Please sign in to comment.