From ef0309c14137a3f3322ff170ecdf6a6eceb9dc95 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Tue, 14 Nov 2017 15:58:17 +0100 Subject: [PATCH] Fix wxTypeIdentifier::operator==() to be const Comparing things doesn't change them. Also rewrite operator!=() in terms of operator==() to ensure consistency. --- include/wx/typeinfo.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/include/wx/typeinfo.h b/include/wx/typeinfo.h index a783af5d56..14fb057fc9 100644 --- a/include/wx/typeinfo.h +++ b/include/wx/typeinfo.h @@ -68,14 +68,14 @@ public: m_className = className; } - bool operator==(const wxTypeIdentifier& other) + bool operator==(const wxTypeIdentifier& other) const { 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: const char* m_className;