mirror of
https://github.com/catchorg/Catch2.git
synced 2024-11-22 21: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
@ -75,44 +75,6 @@ private:
|
||||
ResultInfoBuilder& m_result;
|
||||
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
|
||||
|
||||
|
@ -36,23 +36,6 @@ public:
|
||||
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> expr( m_result, value );
|
||||
return expr;
|
||||
|
Loading…
Reference in New Issue
Block a user