Skip to content

Commit

Permalink
fix enable-if ordering
Browse files Browse the repository at this point in the history
  • Loading branch information
jbcoe committed Sep 24, 2016
1 parent 22370db commit e0f7964
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions include/internal/catch_approx.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,14 @@ namespace Detail {
return approx;
}
#if defined(__cplusplus) && __cplusplus >= 201103L
template <typename T, typename = typename std::enable_if<std::is_constructible<T, double>::value>::type>
template <typename T, typename = typename std::enable_if<std::is_constructible<double, T>::value>::type>
friend bool operator == ( const T& lhs, Approx const& rhs ) {
// Thanks to Richard Harris for his help refining this formula
auto lhs_v = (double)lhs;
auto lhs_v = double(lhs);
return fabs( lhs_v - rhs.m_value ) < rhs.m_epsilon * (rhs.m_scale + (std::max)( fabs(lhs_v), fabs(rhs.m_value) ) );
}

template <typename T, typename = typename std::enable_if<std::is_constructible<T, double>::value>::type>
template <typename T, typename = typename std::enable_if<std::is_constructible<double, T>::value>::type>
friend bool operator == ( Approx const& lhs, const T& rhs ) {
return operator==( rhs, lhs );
}
Expand Down

0 comments on commit e0f7964

Please sign in to comment.