mirror of
https://github.com/catchorg/Catch2.git
synced 2024-11-26 15:26:11 +01:00
Hold values by value and references by reference
This commit is contained in:
parent
0653f4880b
commit
08a1b51987
@ -367,7 +367,7 @@ public:
|
|||||||
Expression
|
Expression
|
||||||
(
|
(
|
||||||
MutableResultInfo& result,
|
MutableResultInfo& result,
|
||||||
const T& lhs
|
T lhs
|
||||||
)
|
)
|
||||||
: m_result( result ),
|
: m_result( result ),
|
||||||
m_lhs( lhs )
|
m_lhs( lhs )
|
||||||
@ -475,7 +475,7 @@ public:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
MutableResultInfo& m_result;
|
MutableResultInfo& m_result;
|
||||||
const T& m_lhs;
|
T m_lhs;
|
||||||
};
|
};
|
||||||
|
|
||||||
template<typename LhsT>
|
template<typename LhsT>
|
||||||
@ -564,12 +564,12 @@ public:
|
|||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////
|
||||||
template<typename T>
|
template<typename T>
|
||||||
Expression<T> operator->*
|
Expression<const T&> operator->*
|
||||||
(
|
(
|
||||||
const T & operand
|
const T & operand
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
Expression<T> expr( m_result, operand );
|
Expression<const T&> expr( m_result, operand );
|
||||||
|
|
||||||
return expr;
|
return expr;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user