-
-
Notifications
You must be signed in to change notification settings - Fork 7.3k
Closed
Labels
state: please discussplease discuss the issue or vote for your favorite optionplease discuss the issue or vote for your favorite option
Description
What's the general opinion about allowing json objects in a boolean context? For example:
json j = nullptr;
if (!j) {
std::cout << "The object is null\n";
}if (j) should be the same as if (!j.is_null()), and if (!j) should be the same as if (j.is_null()).
In the present version, the code above throws an exception ("[json.exception.type_error.302] type must be boolean, but is object").
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
state: please discussplease discuss the issue or vote for your favorite optionplease discuss the issue or vote for your favorite option