diff --git a/maths.hpp b/maths.hpp index 1d80b106..adc7dc47 100644 --- a/maths.hpp +++ b/maths.hpp @@ -50,33 +50,11 @@ namespace cruft { // Useful for explictly ignore equality warnings #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wfloat-equal" - template - constexpr - typename std::enable_if_t< - std::is_arithmetic::value && - std::is_arithmetic::value, - bool - > - equal (const Ta &a, const Tb &b) + template + constexpr auto + equal (ValueA const &a, ValueB const &b) { - // use double not to force conversion for types with explicit bool - // operators on the result of equality - return !!(a == b); - } - - //------------------------------------------------------------------------- - template - inline - typename std::enable_if_t< - !std::is_arithmetic::value || - !std::is_arithmetic::value, - bool - > - equal (const Ta &a, const Tb &b) - { - // use double not to force conversion for types with explicit bool - // operators on the result of equality - return !!(a == b); + return a == b; } #pragma GCC diagnostic pop