We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 45da594 commit 3ca3745Copy full SHA for 3ca3745
include/json/value.h
@@ -385,6 +385,9 @@ Json::Value obj_value(Json::objectValue); // {}
385
/// Return isNull()
386
bool operator!() const;
387
388
+ /// Return !isNull()
389
+ explicit operator bool() const;
390
+
391
/// Remove all object members and array elements.
392
/// \pre type() is arrayValue, objectValue, or nullValue
393
/// \post type() is unchanged
src/lib_json/json_value.cpp
@@ -927,6 +927,8 @@ bool Value::empty() const {
927
928
bool Value::operator!() const { return isNull(); }
929
930
+Value::operator bool() const { return !isNull(); }
931
932
void Value::clear() {
933
JSON_ASSERT_MESSAGE(type_ == nullValue || type_ == arrayValue ||
934
type_ == objectValue,
0 commit comments