mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-05 01:05:34 +08:00
refs #434 CPropertyIndexVariantMap: removed operator templates and replaced CVariant comparison operators with a named method, matches().
This commit is contained in:
@@ -17,6 +17,8 @@
|
||||
|
||||
namespace BlackMisc
|
||||
{
|
||||
class CPropertyIndexVariantMap;
|
||||
|
||||
namespace Predicates
|
||||
{
|
||||
|
||||
@@ -98,6 +100,14 @@ namespace BlackMisc
|
||||
template <class U> bool operator ()(const U &other) const { return other == m_value; }
|
||||
};
|
||||
|
||||
//! \private
|
||||
struct Matches
|
||||
{
|
||||
const CPropertyIndexVariantMap &m_map;
|
||||
Matches(const CPropertyIndexVariantMap &map) : m_map(map) {}
|
||||
template <class T> bool operator()(const T &value) const;
|
||||
};
|
||||
|
||||
} //namespace Private
|
||||
|
||||
/*!
|
||||
@@ -173,6 +183,14 @@ namespace BlackMisc
|
||||
return { std::forward<T>(value), 0 };
|
||||
}
|
||||
|
||||
/*!
|
||||
* Predicate which is true if its argument matches a captured CPropertyIndexVariantMap.
|
||||
*/
|
||||
inline auto Matches(const CPropertyIndexVariantMap &map) -> Private::Matches
|
||||
{
|
||||
return { map };
|
||||
}
|
||||
|
||||
} //namespace Predicates
|
||||
|
||||
} //namespace BlackMisc
|
||||
|
||||
Reference in New Issue
Block a user