switch from ->* to <= in expression decomposer

<= chosen arbitrarily from comparison operators, but any of <=, >=, <, >
have the same precedence.

This now allows expressions containing any of *, /, %, +, -, << and >>
to be used on the LHS.

No tests broke, and the corresponding originally failing test in
[tricky] was expanded and added to the main suite.
This commit is contained in:
Thomas Lamb
2014-08-06 03:25:56 -07:00
parent 08dc8458c0
commit 6a6b41411c
3 changed files with 12 additions and 12 deletions

View File

@@ -41,8 +41,8 @@ namespace Catch {
ResultDisposition::Flags resultDisposition );
template<typename T>
ExpressionLhs<T const&> operator->* ( T const& operand );
ExpressionLhs<bool> operator->* ( bool value );
ExpressionLhs<T const&> operator<= ( T const& operand );
ExpressionLhs<bool> operator<= ( bool value );
template<typename T>
ResultBuilder& operator << ( T const& value ) {
@@ -93,11 +93,11 @@ namespace Catch {
namespace Catch {
template<typename T>
inline ExpressionLhs<T const&> ResultBuilder::operator->* ( T const& operand ) {
inline ExpressionLhs<T const&> ResultBuilder::operator<= ( T const& operand ) {
return ExpressionLhs<T const&>( *this, operand );
}
inline ExpressionLhs<bool> ResultBuilder::operator->* ( bool value ) {
inline ExpressionLhs<bool> ResultBuilder::operator<= ( bool value ) {
return ExpressionLhs<bool>( *this, value );
}