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
2026-10-09 16:18:50 +02:00
parent 882675320b
commit 2d1f109f8b
11 changed files with 19 additions and 70 deletions

View File

@@ -62,7 +62,6 @@ element access, iteration, `get<T>()`, JSON Pointer support, `dump()`, or compar
- [**is_primitive**](is_primitive.md) - return whether the type is primitive
- [**is_structured**](is_structured.md) - return whether the type is structured
- [**is_discarded**](is_discarded.md) - return whether the view is invalid
- [**operator bool**](operator_bool.md) - return whether the view refers to a value
### Capacity