refs #434 CPropertyIndexVariantMap: removed operator templates and replaced CVariant comparison operators with a named method, matches().

This commit is contained in:
Mathew Sutcliffe
2015-06-01 21:06:43 +01:00
parent e76015004b
commit ada03ee513
5 changed files with 35 additions and 52 deletions

View File

@@ -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