Class BinaryExpr

Synopsis

#include <include/internal/catch_decomposer.h>

template<typename LhsT, typename RhsT>
class BinaryExpr  : public ITransientExpression

Description

No description yet.

Inheritance

Ancestors: ITransientExpression

Methods

BinaryExpr
operator!=
operator&&
operator<
operator<=
operator==
operator>
operator>=
operator||

Source

Lines 49-123 in include/internal/catch_decomposer.h.

template<typename LhsT, typename RhsT>
class BinaryExpr  : public ITransientExpression {
    LhsT m_lhs;
    StringRef m_op;
    RhsT m_rhs;
    void streamReconstructedExpression( std::ostream &os ) const override {
        formatReconstructedExpression
                ( os, Catch::Detail::stringify( m_lhs ), m_op, Catch::Detail::stringify( m_rhs ) );
    }
public:
    BinaryExpr( bool comparisonResult, LhsT lhs, StringRef op, RhsT rhs )
    :   ITransientExpression{ true, comparisonResult },
        m_lhs( lhs ),
        m_op( op ),
        m_rhs( rhs )
    {}
    template<typename T>
    auto operator && ( T ) const -> BinaryExpr<LhsT, RhsT const&> const {
        static_assert(always_false<T>::value,
        "chained comparisons are not supported inside assertions, "
        "wrap the expression inside parentheses, or decompose it");
    }
    template<typename T>
    auto operator || ( T ) const -> BinaryExpr<LhsT, RhsT const&> const {
        static_assert(always_false<T>::value,
        "chained comparisons are not supported inside assertions, "
        "wrap the expression inside parentheses, or decompose it");
    }
    template<typename T>
    auto operator == ( T ) const -> BinaryExpr<LhsT, RhsT const&> const {
        static_assert(always_false<T>::value,
        "chained comparisons are not supported inside assertions, "
        "wrap the expression inside parentheses, or decompose it");
    }
    template<typename T>
    auto operator != ( T ) const -> BinaryExpr<LhsT, RhsT const&> const {
        static_assert(always_false<T>::value,
        "chained comparisons are not supported inside assertions, "
        "wrap the expression inside parentheses, or decompose it");
    }
    template<typename T>
    auto operator > ( T ) const -> BinaryExpr<LhsT, RhsT const&> const {
        static_assert(always_false<T>::value,
        "chained comparisons are not supported inside assertions, "
        "wrap the expression inside parentheses, or decompose it");
    }
    template<typename T>
    auto operator < ( T ) const -> BinaryExpr<LhsT, RhsT const&> const {
        static_assert(always_false<T>::value,
        "chained comparisons are not supported inside assertions, "
        "wrap the expression inside parentheses, or decompose it");
    }
    template<typename T>
    auto operator >= ( T ) const -> BinaryExpr<LhsT, RhsT const&> const {
        static_assert(always_false<T>::value,
        "chained comparisons are not supported inside assertions, "
        "wrap the expression inside parentheses, or decompose it");
    }
    template<typename T>
    auto operator <= ( T ) const -> BinaryExpr<LhsT, RhsT const&> const {
        static_assert(always_false<T>::value,
        "chained comparisons are not supported inside assertions, "
        "wrap the expression inside parentheses, or decompose it");
    }
};





Add Discussion as Guest

Log in