mirror of
https://github.com/catchorg/Catch2.git
synced 2024-11-26 07:16:10 +01:00
Directly set Approx's members in operator()
This avoids instantiating the member-setting function template and checking the invariants in cases where we know the invariant already holds.
This commit is contained in:
parent
84fa76e985
commit
ef9150fe6f
@ -35,9 +35,9 @@ namespace Detail {
|
|||||||
template <typename T, typename = typename std::enable_if<std::is_constructible<double, T>::value>::type>
|
template <typename T, typename = typename std::enable_if<std::is_constructible<double, T>::value>::type>
|
||||||
Approx operator()( T const& value ) {
|
Approx operator()( T const& value ) {
|
||||||
Approx approx( static_cast<double>(value) );
|
Approx approx( static_cast<double>(value) );
|
||||||
approx.epsilon( m_epsilon );
|
approx.m_epsilon = m_epsilon;
|
||||||
approx.margin( m_margin );
|
approx.m_margin = m_margin;
|
||||||
approx.scale( m_scale );
|
approx.m_scale = m_scale;
|
||||||
return approx;
|
return approx;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user