Regenerate the amalgamated headers

Signed-off-by: Niels Lohmann <mail@nlohmann.me>
This commit is contained in:
Niels Lohmann committed 2026-10-09 23:51:18 +02:00
1 parent 30d8ddd65a
commit 4e2e4f3184
1 file changed
+16 -3
+16 -3
View File
@@ -503,6 +503,13 @@ struct document_data
template<bool Editable>
struct navigation
{
/// whether the walk follows edits (the template argument as a runtime
/// condition: `Editable && ...` is a constant condition for MSVC, C4127)
static NLOHMANN_VIEW_ALWAYS_INLINE bool editable() noexcept
{
return false;
}
static NLOHMANN_VIEW_ALWAYS_INLINE const node* first(const document_data& /*d*/, const node* n) noexcept
{
return n + 1;
@@ -522,6 +529,11 @@ struct navigation
template<>
struct navigation<true>
{
static NLOHMANN_VIEW_ALWAYS_INLINE bool editable() noexcept
{
return true;
}
static NLOHMANN_VIEW_ALWAYS_INLINE const node* first(const document_data& d, const node* n) noexcept
{
return d.first_child_edited(n);
@@ -3146,7 +3158,7 @@ template<bool Editable>
const node* find_member(const document_data& d, const node* object, const char* key, std::size_t n) noexcept
{
using nav = navigation<Editable>;
if (NLOHMANN_VIEW_UNLIKELY(object->extra != 0) && (!Editable || (object->flags & node_flags::moved) == 0))
if (NLOHMANN_VIEW_UNLIKELY(object->extra != 0) && (!nav::editable() || (object->flags & node_flags::moved) == 0))
{
return find_indexed(d, object, key, n); // a large object (whose members have not been edited)
}
@@ -3197,8 +3209,9 @@ SizeType to_index(IntegerType idx) noexcept
template<bool Editable>
const node* element_at(const document_data& d, const node* array, std::size_t idx) noexcept
{
const node* e = navigation<Editable>::first(d, array);
if (Editable && (array->flags & node_flags::moved) != 0 && d.edits->moved_cap[array->off] != 0)
using nav = navigation<Editable>;
const node* e = nav::first(d, array);
if (nav::editable() && (array->flags & node_flags::moved) != 0 && d.edits->moved_cap[array->off] != 0)
{
return e + idx; // a growable block: one link per element
}