mirror of
https://github.com/nlohmann/json.git
synced 2026-10-10 08:27:13 +00:00
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:
11 files changed
+19
-70
No files matched your search
@@ -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 //
|
||||
//////////////
|
||||
|
||||
Reference in new issue
Block a user