Add assert_invariant call to catch errors earlier
This commit is contained in:
parent
1a8ae08495
commit
80688bd32a
@ -3713,6 +3713,7 @@ class basic_json // NOLINT(cppcoreguidelines-special-member-functions,hicpp-spec
|
||||
set_parents(begin() + static_cast<typename iterator::difference_type>(old_size), static_cast<typename iterator::difference_type>(idx + 1 - old_size));
|
||||
}
|
||||
#endif
|
||||
assert_invariant();
|
||||
}
|
||||
|
||||
return m_value.array->operator[](idx);
|
||||
|
||||
@ -21119,6 +21119,7 @@ class basic_json // NOLINT(cppcoreguidelines-special-member-functions,hicpp-spec
|
||||
set_parents(begin() + static_cast<typename iterator::difference_type>(old_size), static_cast<typename iterator::difference_type>(idx + 1 - old_size));
|
||||
}
|
||||
#endif
|
||||
assert_invariant();
|
||||
}
|
||||
|
||||
return m_value.array->operator[](idx);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user