From 22d6b93f105eb4e7cda68da1989c8b92043bf518 Mon Sep 17 00:00:00 2001 From: Mathew Sutcliffe Date: Mon, 15 Dec 2014 18:21:10 +0000 Subject: [PATCH] refs #356 Non-member equality operators for CPropertyIndexVariantMap. --- src/blackmisc/propertyindexvariantmap.cpp | 8 ++++---- src/blackmisc/propertyindexvariantmap.h | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/blackmisc/propertyindexvariantmap.cpp b/src/blackmisc/propertyindexvariantmap.cpp index 1b169e4a1..e09cb9181 100644 --- a/src/blackmisc/propertyindexvariantmap.cpp +++ b/src/blackmisc/propertyindexvariantmap.cpp @@ -30,17 +30,17 @@ namespace BlackMisc /* * == */ - bool CPropertyIndexVariantMap::operator ==(const CPropertyIndexVariantMap &other) const + bool operator ==(const CPropertyIndexVariantMap &a, const CPropertyIndexVariantMap &b) { - return this->m_wildcard == other.m_wildcard && this->m_values == other.m_values; + return a.m_wildcard == b.m_wildcard && a.m_values == b.m_values; } /* * != */ - bool CPropertyIndexVariantMap::operator !=(const CPropertyIndexVariantMap &other) const + bool operator !=(const CPropertyIndexVariantMap &a, const CPropertyIndexVariantMap &b) { - return !(*this == other); + return !(b == a); } /* diff --git a/src/blackmisc/propertyindexvariantmap.h b/src/blackmisc/propertyindexvariantmap.h index c08cf862d..dd2fd51a5 100644 --- a/src/blackmisc/propertyindexvariantmap.h +++ b/src/blackmisc/propertyindexvariantmap.h @@ -92,10 +92,10 @@ namespace BlackMisc void clear() { this->m_values.clear(); } //! Equal operator, required if maps are directly compared, not with CValueObject - bool operator ==(const CPropertyIndexVariantMap &other) const; + friend bool operator ==(const CPropertyIndexVariantMap &a, const CPropertyIndexVariantMap &b); //! Equal operator, required if maps are directly compared, not with CValueObject - bool operator !=(const CPropertyIndexVariantMap &other) const; + friend bool operator !=(const CPropertyIndexVariantMap &a, const CPropertyIndexVariantMap &b); //! Map const QMap &map() const { return this->m_values; }