Remove the conversion to bool from json_view

explicit operator bool meant "refers to a value", which silently differs
from what a basic_json converts to. Use !v.is_discarded() instead.

Signed-off-by: Niels Lohmann <mail@nlohmann.me>
This commit is contained in:
Niels Lohmann committed 2026-10-09 16:18:50 +02:00
1 parent beb83ae03b
commit 7beac68df7
11 files changed
+19 -70

No files matched your search

-6
View File
@@ -156,12 +156,6 @@ class basic_json_view
return type() == value_t::discarded;
}
/// false for discarded views
explicit operator bool() const noexcept
{
return m_node != nullptr;
}
//////////////
// capacity //
//////////////