Fix wxTypeIdentifier::operator==() to be const

Comparing things doesn't change them.

Also rewrite operator!=() in terms of operator==() to ensure
consistency.
This commit is contained in:
Vadim Zeitlin 2017-11-14 15:58:17 +01:00
parent 0d62f728ae
commit ef0309c141

View File

@ -68,14 +68,14 @@ public:
m_className = className; m_className = className;
} }
bool operator==(const wxTypeIdentifier& other) bool operator==(const wxTypeIdentifier& other) const
{ {
return strcmp(m_className, other.m_className) == 0; return strcmp(m_className, other.m_className) == 0;
} }
bool operator!=(const wxTypeIdentifier& other) bool operator!=(const wxTypeIdentifier& other) const
{ {
return strcmp(m_className, other.m_className) != 0; return !(*this == other);
} }
private: private:
const char* m_className; const char* m_className;