mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-20 04:25:42 +08:00
Issue #15 Added CVariant::matches()
If the contained object type has a matches() method, CVariant::matches() will call that method and return its result. (This is a utility to allow using CVariant to represent an event subscription.)
This commit is contained in:
@@ -193,7 +193,8 @@ namespace BlackMisc
|
||||
bool matchesVariant(const CVariant &value) const;
|
||||
|
||||
//! True if this map matches the value
|
||||
template <typename T> bool matches(const T &value) const { return matchesVariant(CVariant::from(value)); }
|
||||
template <typename T, typename = std::enable_if_t<!std::is_same<T, CVariant>::value>>
|
||||
bool matches(const T &value) const { return matchesVariant(CVariant::from(value)); }
|
||||
|
||||
//! Map
|
||||
const QMap<CPropertyIndex, CVariant> &map() const { return m_values; }
|
||||
|
||||
Reference in New Issue
Block a user