Fix Objective-C Matchers

Fixes #854
This commit is contained in:
Phil Nash 2017-03-13 15:40:21 +00:00
parent 38b05f1400
commit 0afd52b98d
2 changed files with 29 additions and 18 deletions

View file

@ -34,10 +34,18 @@ namespace Matchers {
MatcherUntypedBase& operator = ( MatcherUntypedBase const& );
};
template<typename ObjectT, typename ComparatorT = ObjectT>
struct MatcherBase : MatcherUntypedBase {
template<typename ObjectT>
struct MatcherMethod {
virtual bool match( ObjectT const& arg ) const = 0;
};
template<typename PtrT>
struct MatcherMethod<PtrT*> {
virtual bool match( PtrT* arg ) const = 0;
};
template<typename ObjectT, typename ComparatorT = ObjectT>
struct MatcherBase : MatcherUntypedBase, MatcherMethod<ObjectT> {
MatchAllOf<ComparatorT> operator && ( MatcherBase const& other ) const;
MatchAnyOf<ComparatorT> operator || ( MatcherBase const& other ) const;