refs #413 CVariant and CPropertyIndexVariantMap equality operator templates support any metatype-registered class, not just CValueObject subclasses.

This commit is contained in:
Mathew Sutcliffe
2015-05-03 15:38:05 +01:00
parent 9f98943c1f
commit 9becc1c666
2 changed files with 8 additions and 8 deletions

View File

@@ -116,22 +116,22 @@ namespace BlackMisc
//! Operator == with CValueObject
//! \todo Still needed?
template <class T, class = typename std::enable_if<IsValueObject<T>::value>::type>
template <class T, class = typename std::enable_if<QMetaTypeId<T>::Defined>::type>
friend bool operator ==(const CPropertyIndexVariantMap &valueMap, const T &valueObject) { return valueMap == CVariant::from(valueObject); }
//! Operator != with CValueObject
//! \todo Still needed?
template <class T, class = typename std::enable_if<IsValueObject<T>::value>::type>
template <class T, class = typename std::enable_if<QMetaTypeId<T>::Defined>::type>
friend bool operator !=(const CPropertyIndexVariantMap &valueMap, const T &valueObject) { return valueMap != CVariant::from(valueObject); }
//! Operator == with CValueObject
//! \todo Still needed?
template <class T, class = typename std::enable_if<IsValueObject<T>::value>::type>
template <class T, class = typename std::enable_if<QMetaTypeId<T>::Defined>::type>
friend bool operator ==(const T &valueObject, const CPropertyIndexVariantMap &valueMap) { return valueMap == CVariant::from(valueObject); }
//! Operator != with CValueObject
//! \todo Still needed?
template <class T, class = typename std::enable_if<IsValueObject<T>::value>::type>
template <class T, class = typename std::enable_if<QMetaTypeId<T>::Defined>::type>
friend bool operator !=(const T &valueObject, const CPropertyIndexVariantMap &valueMap) { return valueMap != CVariant::from(valueObject); }
//! Map