Progmasoft Git

catch3

Progmasoft Catch3: an independently maintained C++17 test framework with a parallel runner, property checks, snapshots and structured results.

Clonegit clone https://git.progmasoft.com/catch3

Hold values by value and references by reference

Commit
08a1b51987d57be145de0ce828bc3b054e698706
Author
Phil Nash ·
Parents
0653f4880ba6

Files · Download .tar.gz

Changes

 include/internal/catch_capture.hpp | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/include/internal/catch_capture.hpp b/include/internal/catch_capture.hpp
index e049d7f5..51e9d999 100644
--- a/include/internal/catch_capture.hpp
+++ b/include/internal/catch_capture.hpp
@@ -367,7 +367,7 @@ public:
     Expression
     (
         MutableResultInfo& result, 
-        const T& lhs 
+        T lhs 
     )
     :   m_result( result ),
         m_lhs( lhs )
@@ -475,7 +475,7 @@ public:
 
 private:
     MutableResultInfo& m_result;
-    const T& m_lhs;
+    T m_lhs;
 };
     
 template<typename LhsT> 
@@ -564,12 +564,12 @@ public:
     
     ///////////////////////////////////////////////////////////////////////////
     template<typename T>
-    Expression<T> operator->*
+    Expression<const T&> operator->*
     (
         const T & operand
     )
     {
-        Expression<T> expr( m_result, operand );
+        Expression<const T&> expr( m_result, operand );
         
         return expr;
     }