From c97927f2428db18989c61b0516d83c0907aa4c10 Mon Sep 17 00:00:00 2001 From: kentsangkm Date: Sat, 21 Mar 2015 16:49:00 +0800 Subject: [PATCH] Resolved #359 Eclipse header indexer did not handle the operator->* correctly. So rename the function from operator->* to eval can resolve the Eclipse false alert. --- include/internal/catch_capture.hpp | 2 +- include/internal/catch_result_builder.h | 8 ++++---- single_include/catch.hpp | 10 +++++----- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/include/internal/catch_capture.hpp b/include/internal/catch_capture.hpp index 1285b31f..628e4040 100644 --- a/include/internal/catch_capture.hpp +++ b/include/internal/catch_capture.hpp @@ -33,7 +33,7 @@ do { \ Catch::ResultBuilder __catchResult( macroName, CATCH_INTERNAL_LINEINFO, #expr, resultDisposition ); \ try { \ - ( __catchResult->*expr ).endExpression(); \ + __catchResult.eval(expr).endExpression(); \ } \ catch( ... ) { \ __catchResult.useActiveException( Catch::ResultDisposition::Normal ); \ diff --git a/include/internal/catch_result_builder.h b/include/internal/catch_result_builder.h index 3963c26d..1c89e2ac 100644 --- a/include/internal/catch_result_builder.h +++ b/include/internal/catch_result_builder.h @@ -41,8 +41,8 @@ namespace Catch { ResultDisposition::Flags resultDisposition ); template - ExpressionLhs operator->* ( T const& operand ); - ExpressionLhs operator->* ( bool value ); + ExpressionLhs eval( T const& operand ); + ExpressionLhs eval( bool value ); template ResultBuilder& operator << ( T const& value ) { @@ -93,11 +93,11 @@ namespace Catch { namespace Catch { template - inline ExpressionLhs ResultBuilder::operator->* ( T const& operand ) { + inline ExpressionLhs ResultBuilder::eval( T const& operand ) { return ExpressionLhs( *this, operand ); } - inline ExpressionLhs ResultBuilder::operator->* ( bool value ) { + inline ExpressionLhs ResultBuilder::eval( bool value ) { return ExpressionLhs( *this, value ); } diff --git a/single_include/catch.hpp b/single_include/catch.hpp index 6b8dfb5e..9fb5394f 100644 --- a/single_include/catch.hpp +++ b/single_include/catch.hpp @@ -724,8 +724,8 @@ namespace Catch { ResultDisposition::Flags resultDisposition ); template - ExpressionLhs operator->* ( T const& operand ); - ExpressionLhs operator->* ( bool value ); + ExpressionLhs eval( T const& operand ); + ExpressionLhs eval( bool value ); template ResultBuilder& operator << ( T const& value ) { @@ -1301,11 +1301,11 @@ private: namespace Catch { template - inline ExpressionLhs ResultBuilder::operator->* ( T const& operand ) { + inline ExpressionLhs ResultBuilder::eval( T const& operand ) { return ExpressionLhs( *this, operand ); } - inline ExpressionLhs ResultBuilder::operator->* ( bool value ) { + inline ExpressionLhs ResultBuilder::eval( bool value ) { return ExpressionLhs( *this, value ); } @@ -1475,7 +1475,7 @@ namespace Catch { do { \ Catch::ResultBuilder __catchResult( macroName, CATCH_INTERNAL_LINEINFO, #expr, resultDisposition ); \ try { \ - ( __catchResult->*expr ).endExpression(); \ + __catchResult.eval(expr).endExpression(); \ } \ catch( ... ) { \ __catchResult.useActiveException( Catch::ResultDisposition::Normal ); \