json_view: node_kind in the node writers, spell out read_only, comment fixes

The builder and the edit functions take and store a node_kind instead of
casting a value_t; the numbering assertions and the comments now speak of
node_kind, and the link kind notes that it follows value_t::discarded.
The read-only aliases name view_mode::read_only like the editable ones.
view_mode.md says the mode is a compile-time property of the type.

Signed-off-by: Niels Lohmann <mail@nlohmann.me>
This commit is contained in:
Niels Lohmann committed 2026-10-26 07:12:05 +01:00
1 parent 266432ea65
commit 20e022655d
10 files changed
+121 -121

No files matched your search

+4 -4
View File
@@ -1641,13 +1641,13 @@ class basic_json_document
};
/// a parsed JSON text for json
using json_document = basic_json_document<json>;
using json_document = basic_json_document<json, view_mode::read_only>;
/// a value of a json_document
using json_view = basic_json_view<json>;
using json_view = basic_json_view<json, view_mode::read_only>;
/// a parsed JSON text for ordered_json
using ordered_json_document = basic_json_document<ordered_json>;
using ordered_json_document = basic_json_document<ordered_json, view_mode::read_only>;
/// a value of an ordered_json_document
using ordered_json_view = basic_json_view<ordered_json>;
using ordered_json_view = basic_json_view<ordered_json, view_mode::read_only>;
/// an editable parsed JSON text for json
using json_editable_document = basic_json_document<json, view_mode::editable>;
/// a value of a json_editable_document