refs #356 Non-member equality operators for CPropertyIndexVariantMap.

This commit is contained in:
Mathew Sutcliffe
2014-12-15 18:21:10 +00:00
parent 6ebe4913f6
commit 22d6b93f10
2 changed files with 6 additions and 6 deletions

View File

@@ -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);
} }
/* /*

View File

@@ -92,10 +92,10 @@ namespace BlackMisc
void clear() { this->m_values.clear(); } void clear() { this->m_values.clear(); }
//! Equal operator, required if maps are directly compared, not with CValueObject //! 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 //! 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 //! Map
const QMap<CPropertyIndex, CVariant> &map() const { return this->m_values; } const QMap<CPropertyIndex, CVariant> &map() const { return this->m_values; }