From ef9150fe6f3c4a3b5836aac1e0cfaaeeccd28d69 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Ho=C5=99e=C5=88ovsk=C3=BD?= Date: Mon, 3 Sep 2018 10:20:58 +0200 Subject: [PATCH] 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. --- include/internal/catch_approx.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/include/internal/catch_approx.h b/include/internal/catch_approx.h index c0696307..4522e5ad 100644 --- a/include/internal/catch_approx.h +++ b/include/internal/catch_approx.h @@ -35,9 +35,9 @@ namespace Detail { template ::value>::type> Approx operator()( T const& value ) { Approx approx( static_cast(value) ); - approx.epsilon( m_epsilon ); - approx.margin( m_margin ); - approx.scale( m_scale ); + approx.m_epsilon = m_epsilon; + approx.m_margin = m_margin; + approx.m_scale = m_scale; return approx; }