From 9becc1c666a8fb9d198651e2dfc3a9d530a5fc82 Mon Sep 17 00:00:00 2001 From: Mathew Sutcliffe Date: Sun, 3 May 2015 15:38:05 +0100 Subject: [PATCH] refs #413 CVariant and CPropertyIndexVariantMap equality operator templates support any metatype-registered class, not just CValueObject subclasses. --- src/blackmisc/propertyindexvariantmap.h | 8 ++++---- src/blackmisc/variant.h | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/blackmisc/propertyindexvariantmap.h b/src/blackmisc/propertyindexvariantmap.h index b609c1b45..558ac48be 100644 --- a/src/blackmisc/propertyindexvariantmap.h +++ b/src/blackmisc/propertyindexvariantmap.h @@ -116,22 +116,22 @@ namespace BlackMisc //! Operator == with CValueObject //! \todo Still needed? - template ::value>::type> + template ::Defined>::type> friend bool operator ==(const CPropertyIndexVariantMap &valueMap, const T &valueObject) { return valueMap == CVariant::from(valueObject); } //! Operator != with CValueObject //! \todo Still needed? - template ::value>::type> + template ::Defined>::type> friend bool operator !=(const CPropertyIndexVariantMap &valueMap, const T &valueObject) { return valueMap != CVariant::from(valueObject); } //! Operator == with CValueObject //! \todo Still needed? - template ::value>::type> + template ::Defined>::type> friend bool operator ==(const T &valueObject, const CPropertyIndexVariantMap &valueMap) { return valueMap == CVariant::from(valueObject); } //! Operator != with CValueObject //! \todo Still needed? - template ::value>::type> + template ::Defined>::type> friend bool operator !=(const T &valueObject, const CPropertyIndexVariantMap &valueMap) { return valueMap != CVariant::from(valueObject); } //! Map diff --git a/src/blackmisc/variant.h b/src/blackmisc/variant.h index 96613982c..864659eca 100644 --- a/src/blackmisc/variant.h +++ b/src/blackmisc/variant.h @@ -239,7 +239,7 @@ namespace BlackMisc }; //! Compare stored value of CVariant with any CValueObject derived class. - template ::value>::type> + template ::Defined>::type> bool operator ==(const T &value, const CVariant &variant) { if (variant.canConvert()) { return variant.value() == value; } @@ -247,21 +247,21 @@ namespace BlackMisc } //! Compare stored value of CVariant with any CValueObject derived class. - template ::value>::type> + template ::Defined>::type> bool operator !=(const T &value, const CVariant &variant) { return !(value == variant); } //! Compare stored value of CVariant with any CValueObject derived class. - template ::value>::type> + template ::Defined>::type> bool operator ==(const CVariant &variant, const T &value) { return value == variant; } //! Compare stored value of CVariant with any CValueObject derived class. - template ::value>::type> + template ::Defined>::type> bool operator !=(const CVariant &variant, const T &value) { return !(value == variant);