Add char* equality for json::strings

This commit is contained in:
Danny Robson 2012-04-20 18:18:47 +10:00
parent 89fb2b238c
commit 598f125d53
2 changed files with 6 additions and 0 deletions

View File

@ -511,6 +511,11 @@ json::string::operator ==(const json::string &rhs) const
{ return rhs.m_value == m_value; }
bool
json::string::operator ==(const char *rhs) const
{ return rhs == m_value; }
//
// Number
//

View File

@ -167,6 +167,7 @@ namespace json {
virtual const string& as_string (void) const { return *this; }
virtual bool is_string (void) const { return true; }
virtual bool operator==(const char *rhs) const;
virtual bool operator==(const string &rhs) const;
virtual bool operator==(const node &rhs) const
{ return rhs == *this; }