Skip to content

Commit

Permalink
use CATCH_CPP11_OR_GREATER macro
Browse files Browse the repository at this point in the history
  • Loading branch information
jbcoe committed Oct 4, 2016
1 parent d3f930a commit e1356fe
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 @@ -44,7 +44,7 @@ namespace Detail {
approx.scale( m_scale );
return approx;
}
#if defined(__cplusplus) && __cplusplus >= 201103L
#if CATCH_CPP11_OR_GREATER
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
Expand All @@ -56,7 +56,7 @@ namespace Detail {
friend bool operator == ( Approx const& lhs, const T& rhs ) {
return operator==( rhs, lhs );
}
#else // defined(__cplusplus) && __cplusplus >= 201103L
#else
friend bool operator == ( double lhs, Approx const& rhs ) {
// Thanks to Richard Harris for his help refining this formula
return fabs( lhs - rhs.m_value ) < rhs.m_epsilon * (rhs.m_scale + (std::max)( fabs(lhs), fabs(rhs.m_value) ) );
Expand All @@ -65,7 +65,7 @@ namespace Detail {
friend bool operator == ( Approx const& lhs, double rhs ) {
return operator==( rhs, lhs );
}
#endif // defined(__cplusplus) && __cplusplus >= 201103L
#endif

friend bool operator != ( double lhs, Approx const& rhs ) {
return !operator==( lhs, rhs );
Expand Down

0 comments on commit e1356fe

Please sign in to comment.