Skip to content
This repository
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

file 31 lines (23 sloc) 0.918 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
#import "ActualValue.h"

namespace Cedar { namespace Matchers {

    struct ActualValueMarker {
        const char *fileName;
        int lineNumber;
    };

    template<typename T>
    const ActualValue<T> operator,(const T & actualValue, const ActualValueMarker & marker) {
        return ActualValue<T>(marker.fileName, marker.lineNumber, actualValue);
    }

    template<typename T>
    const ActualValueMatchProxy<T> operator,(const ActualValue<T> & actualValue, bool negate) {
        return negate ? actualValue.to_not : actualValue.to;
    }

    template<typename T, typename MatcherType>
    void operator,(const ActualValueMatchProxy<T> & matchProxy, const MatcherType & matcher) {
        matchProxy(matcher);
    }

}}

#ifndef CEDAR_MATCHERS_DISALLOW_SHOULD
#define should ,(ActualValueMarker){__FILE__, __LINE__},false,
#define should_not ,(ActualValueMarker){__FILE__, __LINE__},true,
#endif
Something went wrong with that request. Please try again.