Add json::node equality operators and specialise

This commit is contained in:
Danny Robson 2012-04-19 16:41:54 +10:00
parent 036f0fab51
commit cae41d87fb

View File

@ -323,8 +323,13 @@ json::node::operator!=(const node &rhs) const
{ return !(*this == rhs); }
bool json::node::operator==(const char *rhs) const
{ return as_string () == rhs; }
bool json::node::operator==(const char *rhs) const {
try {
return as_string () == rhs;
} catch (const json::type_error&) {
return false;
}
}
const json::node&