From 39c59b89be17b4ab1f0f40b8959fd33e93921955 Mon Sep 17 00:00:00 2001 From: "Kuan-Fu, Wu" <70022495+kfwu1999@users.noreply.github.com> Date: Thu, 22 May 2025 18:39:39 +0800 Subject: [PATCH] doc: Fix JSON Pointer example to use direct initialization (#4468) 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. Signed-off-by: Niels Lohmann --- docs/mkdocs/docs/features/json_pointer.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/mkdocs/docs/features/json_pointer.md b/docs/mkdocs/docs/features/json_pointer.md index df66ebffd..a16e8df24 100644 --- a/docs/mkdocs/docs/features/json_pointer.md +++ b/docs/mkdocs/docs/features/json_pointer.md @@ -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: