mirror of
				https://github.com/catchorg/Catch2.git
				synced 2025-10-31 12:17:11 +01:00 
			
		
		
		
	Use <= operator instead of ->* for decomposer
Allows more complex LHS expressions - and works around an Eclipse bug. See Issues #359, #393 and #247 for details
This commit is contained in:
		| @@ -33,7 +33,7 @@ | ||||
|     do { \ | ||||
|         Catch::ResultBuilder __catchResult( macroName, CATCH_INTERNAL_LINEINFO, #expr, resultDisposition ); \ | ||||
|         try { \ | ||||
|             ( __catchResult->*expr ).endExpression(); \ | ||||
|             ( __catchResult <= expr ).endExpression(); \ | ||||
|         } \ | ||||
|         catch( ... ) { \ | ||||
|             __catchResult.useActiveException( Catch::ResultDisposition::Normal ); \ | ||||
|   | ||||
| @@ -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 ); | ||||
|     } | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Phil Nash
					Phil Nash