Correct me if I'm wrong, but using a const json obj + .at() + try/catch is the only way safe to test for object key exists. This seems REALLY brutal compared to the ease of use using the rest of the library
Perhaps there'd be some way to return a bool operator comparable for object gets along the lines of
if(auto possibleVal = json["maybeExists"])
{
//possibleVal exists
}
or.. at the very least, a .exists(const std::string &) method would be helpful..
Correct me if I'm wrong, but using a const json obj + .at() + try/catch is the only way safe to test for object key exists. This seems REALLY brutal compared to the ease of use using the rest of the library
Perhaps there'd be some way to return a bool operator comparable for object gets along the lines of
or.. at the very least, a .exists(const std::string &) method would be helpful..