ApproxMacher uses Approx's overloads for double directly

This saves a tiny little bit of compilation times when the
`ApproxMatcher` is used and `epsilon`, `margin`, or `scale` are
used to customize its behaviour.
This commit is contained in:
Martin Hořeňovský 2020-08-11 19:07:14 +02:00
parent aa28a917cb
commit 05d7014e75
No known key found for this signature in database
GPG Key ID: DE48307B8B0D381A
1 changed files with 3 additions and 3 deletions

View File

@ -116,17 +116,17 @@ namespace Matchers {
} }
template <typename = std::enable_if_t<std::is_constructible<double, T>::value>> template <typename = std::enable_if_t<std::is_constructible<double, T>::value>>
ApproxMatcher& epsilon( T const& newEpsilon ) { ApproxMatcher& epsilon( T const& newEpsilon ) {
approx.epsilon(newEpsilon); approx.epsilon(static_cast<double>(newEpsilon));
return *this; return *this;
} }
template <typename = std::enable_if_t<std::is_constructible<double, T>::value>> template <typename = std::enable_if_t<std::is_constructible<double, T>::value>>
ApproxMatcher& margin( T const& newMargin ) { ApproxMatcher& margin( T const& newMargin ) {
approx.margin(newMargin); approx.margin(static_cast<double>(newMargin));
return *this; return *this;
} }
template <typename = std::enable_if_t<std::is_constructible<double, T>::value>> template <typename = std::enable_if_t<std::is_constructible<double, T>::value>>
ApproxMatcher& scale( T const& newScale ) { ApproxMatcher& scale( T const& newScale ) {
approx.scale(newScale); approx.scale(static_cast<double>(newScale));
return *this; return *this;
} }