📝 update documentation (#4723)

Signed-off-by: Niels Lohmann <mail@nlohmann.me>
This commit is contained in:
Niels Lohmann authored and GitHub committed 2025-04-05 18:54:35 +02:00
1 parent 11aa5f944d
commit 4424a0fcc1
90 files changed
+377 -339

No files matched your search

@@ -8,14 +8,14 @@ This macro enables position diagnostics for generated JSON objects.
When enabled, two new member functions [`start_pos()`](../basic_json/start_pos.md) and
[`end_pos()`](../basic_json/end_pos.md) are added to [`basic_json`](../basic_json/index.md) values. If the value was
created by calling the[`parse`](../basic_json/parse.md) function, then these functions allow to query the byte positions
created by calling the[`parse`](../basic_json/parse.md) function, then these functions allow querying the byte positions
of the value in the input it was parsed from. In case the value was constructed by other means, `std::string::npos` is
returned.
[`start_pos()`](../basic_json/start_pos.md) returns the position of the first character of a given value in the original
JSON string, while [`end_pos()`](../basic_json/end_pos.md) returns the position of the character _following_ the last
character. For objects and arrays, the first and last characters correspond to the opening or closing braces/brackets,
respectively. For primitive values, the first and last character represent the opening and closing quotes (strings) or
respectively. For primitive values, the first and last character represents the opening and closing quotes (strings) or
the first and last character of the field's numerical or predefined value (`true`, `false`, `null`), respectively.
| JSON type | return value [`start_pos()`](../basic_json/start_pos.md) | return value [`end_pos()`](../basic_json/end_pos.md) |