Add json::node equality operators and specialise
This commit is contained in:
parent
036f0fab51
commit
cae41d87fb
@ -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&
|
||||
|
Loading…
Reference in New Issue
Block a user