From 8c391e04fe4195d8be862c97f38cfe10e2a3472e Mon Sep 17 00:00:00 2001 From: Fallen_Breath Date: Sat, 13 Apr 2024 20:15:00 +0800 Subject: [PATCH] Docs: Fix wrong code usage in the Value access section of `json_pointer.md` (#4255) --- docs/mkdocs/docs/features/json_pointer.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/mkdocs/docs/features/json_pointer.md b/docs/mkdocs/docs/features/json_pointer.md index 04aeca504..4fd58f20e 100644 --- a/docs/mkdocs/docs/features/json_pointer.md +++ b/docs/mkdocs/docs/features/json_pointer.md @@ -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