Document the json_default_base natvis fallback and regenerate natvis

Explain why a visualizer on the empty base class works, fix the
indentation of the new entry, and regenerate nlohmann_json.natvis from
the template (now covering all ABI tag combinations on develop).

Signed-off-by: Niels Lohmann <mail@nlohmann.me>
This commit is contained in:
Niels Lohmann
2026-09-27 14:52:34 +02:00
parent 1a5d52404e
commit 055158bbfa
2 changed files with 2972 additions and 2 deletions
+2967
View File
File diff suppressed because it is too large Load Diff
@@ -36,6 +36,9 @@
</Expand>
</Type>
<!-- Fallback for when the basic_json entry above does not match: json_default_base is the (empty) default
base class of basic_json, and base class visualizers are inherited by derived types and evaluated
against the derived object, so m_data is accessible here. -->
<Type Name="{{ ns }}::detail::json_default_base">
<DisplayString Condition="m_data.m_type == {{ ns }}::detail::value_t::null">null</DisplayString>
<DisplayString Condition="m_data.m_type == {{ ns }}::detail::value_t::object">{*(m_data.m_value.object)}</DisplayString>
@@ -48,10 +51,10 @@
<DisplayString Condition="m_data.m_type == {{ ns }}::detail::value_t::discarded">discarded</DisplayString>
<Expand>
<ExpandedItem Condition="m_data.m_type == {{ ns }}::detail::value_t::object">
*(m_data.m_value.object),view(simple)
*(m_data.m_value.object),view(simple)
</ExpandedItem>
<ExpandedItem Condition="m_data.m_type == {{ ns }}::detail::value_t::array">
*(m_data.m_value.array),view(simple)
*(m_data.m_value.array),view(simple)
</ExpandedItem>
</Expand>
</Type>