Add json::node equality operators and specialise
This commit is contained in:
parent
036f0fab51
commit
cae41d87fb
11
json.cpp.rl
11
json.cpp.rl
@ -319,12 +319,17 @@ json::node::as_null (void) const
|
|||||||
//
|
//
|
||||||
|
|
||||||
bool
|
bool
|
||||||
json::node::operator!=(const node &rhs) const
|
json::node::operator!= (const node &rhs) const
|
||||||
{ return !(*this == rhs); }
|
{ return !(*this == rhs); }
|
||||||
|
|
||||||
|
|
||||||
bool json::node::operator==(const char *rhs) const
|
bool json::node::operator==(const char *rhs) const {
|
||||||
{ return as_string () == rhs; }
|
try {
|
||||||
|
return as_string () == rhs;
|
||||||
|
} catch (const json::type_error&) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
const json::node&
|
const json::node&
|
||||||
|
Loading…
Reference in New Issue
Block a user