Skip to content

Commit

Permalink
Fix wrong code usage in the Value access section of json_pointer.md
Browse files Browse the repository at this point in the history
  • Loading branch information
Fallen-Breath committed Jan 3, 2024
1 parent a259ecc commit f82d457
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 f82d457

Please sign in to comment.