Merge branch 'json-view/19-edit-set' into json-view/21-images

Signed-off-by: Niels Lohmann <mail@nlohmann.me>

# Conflicts:
#	include/nlohmann/detail/view/document_data.hpp
#	single_include/nlohmann/json_view.hpp
This commit is contained in:
Niels Lohmann committed 2026-10-08 16:37:29 +02:00
commit 92bf5fbfb1
45 files changed
+888 -1094

No files matched your search

+9 -1
View File
@@ -703,11 +703,19 @@ class basic_json_view
return detail::view::view_side<BasicJsonType, basic_json_view>(v);
}
/// the template argument as a runtime condition: testing it directly in
/// `Editable && ...` makes the condition constant, which MSVC reports as
/// C4127
static bool editable() noexcept
{
return Editable;
}
/// the number of source bytes of this value (estimated for values with
/// decoded strings)
std::size_t source_extent() const noexcept
{
if (Editable && m_doc->edits != nullptr)
if (editable() && m_doc->edits != nullptr)
{
// positions of moved and new values are not source offsets
return m_node == m_doc->tape ? m_doc->size + m_doc->edits->text_used : 64;