@@ -10,7 +10,8 @@ When enabled, two new member functions [`start_pos()`](../basic_json/start_pos.m
10
10
[`end_pos()`](../basic_json/end_pos.md) are added to [`basic_json`](../basic_json/index.md) values.
11
11
[`start_pos()`](../basic_json/start_pos.md) returns the start position of that JSON value in the original JSON string
12
12
the object was parsed from. Likewise, [`end_pos()`](../basic_json/end_pos.md) returns the end position of that JSON
13
- value in the original string the object was parsed from.
13
+ value in the original string the object was parsed from. If the value was not parsed, but constructed by other means,
14
+ the functions returns `std::string::npos`.
14
15
15
16
[`start_pos()`](../basic_json/start_pos.md) returns the first character of a given value in the original JSON string,
16
17
while [`end_pos()`](../basic_json/end_pos.md) returns the character _following_ the last character. For objects and
@@ -31,11 +32,9 @@ Given the above, [`end_pos()`](../basic_json/end_pos.md)` - `[`start_pos()`](../
31
32
value provides the length of the parsed JSON string for that value, including the opening or closing braces, brackets,
32
33
or quotes.
33
34
34
- [`start_pos()`](../basic_json/start_pos.md) and [`end_pos()`](../basic_json/end_pos.md) are only set if the JSON value
35
- was parsed using [`parse()`](../basic_json/parse.md). For all other cases,`std::string::npos` will be returned.
36
-
37
35
Note that enabling this macro increases the size of every JSON value by two `std::size_t` fields and adds slight runtime
38
- overhead.
36
+ overhead to parsing, copying JSON value objects, and the generation of error messages for exceptions. It also causes
37
+ these values to be reported in those error messages.
39
38
40
39
## Default definition
41
40
0 commit comments