mirror of
https://github.com/nlohmann/json.git
synced 2026-11-01 10:25:43 +00:00
json_view: address review of the exception diagnostics
- value_path(): check for the empty stack where the last frame is popped, so that the loop is `for (;;)`; update the frame only after the target check; document that the frame reference is not used after pop_back() or push_back() (and add a test with deep documents to run under a sanitizer) - value_range(): flip the container check to remove a level of nesting - diagnostics(): wrap the whole function in the macro check, and compute the path before the bytes, so that nothing is computed when there is no path; the function stays a template - error_site: separate constructors for the two configurations - site_of(): static_assert that it is called with a view - document why the throw helpers without an error_site have none - pointer.hpp: do not split a comment around the template header - docs: "when materialize() sets them"; list the effects of JSON_DIAGNOSTICS and JSON_DIAGNOSTIC_POSITIONS separately Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01N5NasBf4ToHzdcoNEPAJhS
This commit is contained in:
12 files changed
+180
-139
No files matched your search
@@ -63,7 +63,7 @@ Strong guarantee: there are no changes to the view or the document it refers to.
|
||||
|
||||
As for `BasicJsonType`, with [`JSON_DIAGNOSTICS`](../macros/json_diagnostics.md) these exceptions name the JSON
|
||||
Pointer path of the value within the document, and with
|
||||
[`JSON_DIAGNOSTIC_POSITIONS`](../macros/json_diagnostic_positions.md) its bytes in the source text (where
|
||||
[`JSON_DIAGNOSTIC_POSITIONS`](../macros/json_diagnostic_positions.md) its bytes in the source text (when
|
||||
[`materialize()`](materialize.md) sets them).
|
||||
|
||||
## Complexity
|
||||
|
||||
Reference in new issue
Block a user