mirror of
https://github.com/catchorg/Catch2.git
synced 2024-11-26 23:36:11 +01:00
Removed special handling for pointer comparisons
These all seem to be handled by the general case now
This commit is contained in:
parent
73e1bc20bc
commit
be838671ab
@ -76,44 +76,6 @@ private:
|
|||||||
T m_lhs;
|
T m_lhs;
|
||||||
};
|
};
|
||||||
|
|
||||||
template<typename LhsT>
|
|
||||||
class PtrExpression {
|
|
||||||
public:
|
|
||||||
|
|
||||||
PtrExpression ( ResultInfoBuilder& result, const LhsT* lhs )
|
|
||||||
: m_result( &result ),
|
|
||||||
m_lhs( lhs )
|
|
||||||
{}
|
|
||||||
|
|
||||||
template<typename RhsT>
|
|
||||||
ResultInfoBuilder& operator == ( const RhsT* rhs ) {
|
|
||||||
return m_result->captureExpression<Internal::IsEqualTo>( m_lhs, rhs );
|
|
||||||
}
|
|
||||||
|
|
||||||
// This catches NULL
|
|
||||||
ResultInfoBuilder& operator == ( LhsT* rhs ) {
|
|
||||||
return m_result->captureExpression<Internal::IsEqualTo>( m_lhs, rhs );
|
|
||||||
}
|
|
||||||
|
|
||||||
template<typename RhsT>
|
|
||||||
ResultInfoBuilder& operator != ( const RhsT* rhs ) {
|
|
||||||
return m_result->captureExpression<Internal::IsNotEqualTo>( m_lhs, rhs );
|
|
||||||
}
|
|
||||||
|
|
||||||
// This catches NULL
|
|
||||||
ResultInfoBuilder& operator != ( LhsT* rhs ) {
|
|
||||||
return m_result->captureExpression<Internal::IsNotEqualTo>( m_lhs, rhs );
|
|
||||||
}
|
|
||||||
|
|
||||||
operator ResultInfoBuilder& () {
|
|
||||||
return m_result->captureBoolExpression( m_lhs );
|
|
||||||
}
|
|
||||||
|
|
||||||
private:
|
|
||||||
ResultInfoBuilder* m_result;
|
|
||||||
const LhsT* m_lhs;
|
|
||||||
};
|
|
||||||
|
|
||||||
} // end namespace Catch
|
} // end namespace Catch
|
||||||
|
|
||||||
#endif // TWOBLUECUBES_CATCH_EXPRESSION_HPP_INCLUDED
|
#endif // TWOBLUECUBES_CATCH_EXPRESSION_HPP_INCLUDED
|
||||||
|
@ -36,23 +36,6 @@ public:
|
|||||||
return expr;
|
return expr;
|
||||||
}
|
}
|
||||||
|
|
||||||
Expression<const char*> operator->* ( const char* const& operand ) {
|
|
||||||
Expression<const char*> expr( m_result, operand );
|
|
||||||
return expr;
|
|
||||||
}
|
|
||||||
|
|
||||||
template<typename T>
|
|
||||||
PtrExpression<T> operator->* ( const T* operand ) {
|
|
||||||
PtrExpression<T> expr( m_result, operand );
|
|
||||||
return expr;
|
|
||||||
}
|
|
||||||
|
|
||||||
template<typename T>
|
|
||||||
PtrExpression<T> operator->* ( T* operand ) {
|
|
||||||
PtrExpression<T> expr( m_result, operand );
|
|
||||||
return expr;
|
|
||||||
}
|
|
||||||
|
|
||||||
Expression<bool> operator->* ( bool value ) {
|
Expression<bool> operator->* ( bool value ) {
|
||||||
Expression<bool> expr( m_result, value );
|
Expression<bool> expr( m_result, value );
|
||||||
return expr;
|
return expr;
|
||||||
|
Loading…
Reference in New Issue
Block a user