diff --git a/libcxx/include/math.h b/libcxx/include/math.h --- a/libcxx/include/math.h +++ b/libcxx/include/math.h @@ -316,23 +316,18 @@ # undef signbit # endif // signbit -template -inline _LIBCPP_HIDE_FROM_ABI typename std::enable_if::value, bool>::type -signbit(_A1 __x) _NOEXCEPT { +template ::value, int> = 0> +inline _LIBCPP_HIDE_FROM_ABI bool signbit(_A1 __x) _NOEXCEPT { return __builtin_signbit(__x); } -template -inline _LIBCPP_HIDE_FROM_ABI - typename std::enable_if< std::is_integral<_A1>::value && std::is_signed<_A1>::value, bool>::type - signbit(_A1 __x) _NOEXCEPT { +template ::value && std::is_signed<_A1>::value, int> = 0> +inline _LIBCPP_HIDE_FROM_ABI bool signbit(_A1 __x) _NOEXCEPT { return __x < 0; } -template -inline _LIBCPP_HIDE_FROM_ABI - typename std::enable_if< std::is_integral<_A1>::value && !std::is_signed<_A1>::value, bool>::type - signbit(_A1) _NOEXCEPT { +template ::value && !std::is_signed<_A1>::value, int> = 0> +inline _LIBCPP_HIDE_FROM_ABI bool signbit(_A1) _NOEXCEPT { return false; } @@ -342,15 +337,13 @@ # undef fpclassify # endif // fpclassify -template -inline _LIBCPP_HIDE_FROM_ABI typename std::enable_if::value, int>::type -fpclassify(_A1 __x) _NOEXCEPT { +template ::value, int> = 0> +inline _LIBCPP_HIDE_FROM_ABI int fpclassify(_A1 __x) _NOEXCEPT { return __builtin_fpclassify(FP_NAN, FP_INFINITE, FP_NORMAL, FP_SUBNORMAL, FP_ZERO, __x); } -template -inline _LIBCPP_HIDE_FROM_ABI typename std::enable_if::value, int>::type -fpclassify(_A1 __x) _NOEXCEPT { +template ::value, int> = 0> +inline _LIBCPP_HIDE_FROM_ABI int fpclassify(_A1 __x) _NOEXCEPT { return __x == 0 ? FP_ZERO : FP_NORMAL; } @@ -359,17 +352,15 @@ # ifdef isfinite # undef isfinite -template -inline _LIBCPP_HIDE_FROM_ABI - typename std::enable_if< std::is_arithmetic<_A1>::value && std::numeric_limits<_A1>::has_infinity, bool>::type - isfinite(_A1 __x) _NOEXCEPT { +template ::value && std::numeric_limits<_A1>::has_infinity, int> = 0> +inline _LIBCPP_HIDE_FROM_ABI bool isfinite(_A1 __x) _NOEXCEPT { return __builtin_isfinite((typename std::__promote<_A1>::type)__x); } -template -inline _LIBCPP_HIDE_FROM_ABI - typename std::enable_if< std::is_arithmetic<_A1>::value && !std::numeric_limits<_A1>::has_infinity, bool>::type - isfinite(_A1) _NOEXCEPT { +template ::value && !std::numeric_limits<_A1>::has_infinity, int> = 0> +inline _LIBCPP_HIDE_FROM_ABI bool isfinite(_A1) _NOEXCEPT { return true; } @@ -380,10 +371,9 @@ # ifdef isinf # undef isinf -template -inline _LIBCPP_HIDE_FROM_ABI - typename std::enable_if< std::is_arithmetic<_A1>::value && std::numeric_limits<_A1>::has_infinity, bool>::type - isinf(_A1 __x) _NOEXCEPT { +template ::value && std::numeric_limits<_A1>::has_infinity, int> = 0> +inline _LIBCPP_HIDE_FROM_ABI bool isinf(_A1 __x) _NOEXCEPT { return __builtin_isinf((typename std::__promote<_A1>::type)__x); } @@ -409,14 +399,13 @@ # ifdef isnan # undef isnan -template -inline _LIBCPP_HIDE_FROM_ABI typename std::enable_if::value, bool>::type -isnan(_A1 __x) _NOEXCEPT { +template ::value, int> = 0> +inline _LIBCPP_HIDE_FROM_ABI bool isnan(_A1 __x) _NOEXCEPT { return __builtin_isnan(__x); } -template -inline _LIBCPP_HIDE_FROM_ABI typename std::enable_if::value, bool>::type isnan(_A1) _NOEXCEPT { +template ::value, int> = 0> +inline _LIBCPP_HIDE_FROM_ABI bool isnan(_A1) _NOEXCEPT { return false; } @@ -435,15 +424,13 @@ # ifdef isnormal # undef isnormal -template -inline _LIBCPP_HIDE_FROM_ABI typename std::enable_if::value, bool>::type -isnormal(_A1 __x) _NOEXCEPT { +template ::value, int> = 0> +inline _LIBCPP_HIDE_FROM_ABI bool isnormal(_A1 __x) _NOEXCEPT { return __builtin_isnormal(__x); } -template -inline _LIBCPP_HIDE_FROM_ABI typename std::enable_if::value, bool>::type -isnormal(_A1 __x) _NOEXCEPT { +template ::value, int> = 0> +inline _LIBCPP_HIDE_FROM_ABI bool isnormal(_A1 __x) _NOEXCEPT { return __x != 0; } @@ -454,10 +441,10 @@ # ifdef isgreater # undef isgreater -template -inline _LIBCPP_HIDE_FROM_ABI - typename std::enable_if< std::is_arithmetic<_A1>::value && std::is_arithmetic<_A2>::value, bool >::type - isgreater(_A1 __x, _A2 __y) _NOEXCEPT { +template ::value && std::is_arithmetic<_A2>::value, int> = 0> +inline _LIBCPP_HIDE_FROM_ABI bool isgreater(_A1 __x, _A2 __y) _NOEXCEPT { typedef typename std::__promote<_A1, _A2>::type type; return __builtin_isgreater((type)__x, (type)__y); } @@ -469,10 +456,10 @@ # ifdef isgreaterequal # undef isgreaterequal -template -inline _LIBCPP_HIDE_FROM_ABI - typename std::enable_if< std::is_arithmetic<_A1>::value && std::is_arithmetic<_A2>::value, bool >::type - isgreaterequal(_A1 __x, _A2 __y) _NOEXCEPT { +template ::value && std::is_arithmetic<_A2>::value, int> = 0> +inline _LIBCPP_HIDE_FROM_ABI bool isgreaterequal(_A1 __x, _A2 __y) _NOEXCEPT { typedef typename std::__promote<_A1, _A2>::type type; return __builtin_isgreaterequal((type)__x, (type)__y); } @@ -484,10 +471,10 @@ # ifdef isless # undef isless -template -inline _LIBCPP_HIDE_FROM_ABI - typename std::enable_if< std::is_arithmetic<_A1>::value && std::is_arithmetic<_A2>::value, bool >::type - isless(_A1 __x, _A2 __y) _NOEXCEPT { +template ::value && std::is_arithmetic<_A2>::value, int> = 0> +inline _LIBCPP_HIDE_FROM_ABI bool isless(_A1 __x, _A2 __y) _NOEXCEPT { typedef typename std::__promote<_A1, _A2>::type type; return __builtin_isless((type)__x, (type)__y); } @@ -499,10 +486,10 @@ # ifdef islessequal # undef islessequal -template -inline _LIBCPP_HIDE_FROM_ABI - typename std::enable_if< std::is_arithmetic<_A1>::value && std::is_arithmetic<_A2>::value, bool >::type - islessequal(_A1 __x, _A2 __y) _NOEXCEPT { +template ::value && std::is_arithmetic<_A2>::value, int> = 0> +inline _LIBCPP_HIDE_FROM_ABI bool islessequal(_A1 __x, _A2 __y) _NOEXCEPT { typedef typename std::__promote<_A1, _A2>::type type; return __builtin_islessequal((type)__x, (type)__y); } @@ -514,10 +501,10 @@ # ifdef islessgreater # undef islessgreater -template -inline _LIBCPP_HIDE_FROM_ABI - typename std::enable_if< std::is_arithmetic<_A1>::value && std::is_arithmetic<_A2>::value, bool >::type - islessgreater(_A1 __x, _A2 __y) _NOEXCEPT { +template ::value && std::is_arithmetic<_A2>::value, int> = 0> +inline _LIBCPP_HIDE_FROM_ABI bool islessgreater(_A1 __x, _A2 __y) _NOEXCEPT { typedef typename std::__promote<_A1, _A2>::type type; return __builtin_islessgreater((type)__x, (type)__y); } @@ -529,10 +516,10 @@ # ifdef isunordered # undef isunordered -template -inline _LIBCPP_HIDE_FROM_ABI - typename std::enable_if< std::is_arithmetic<_A1>::value && std::is_arithmetic<_A2>::value, bool >::type - isunordered(_A1 __x, _A2 __y) _NOEXCEPT { +template ::value && std::is_arithmetic<_A2>::value, int> = 0> +inline _LIBCPP_HIDE_FROM_ABI bool isunordered(_A1 __x, _A2 __y) _NOEXCEPT { typedef typename std::__promote<_A1, _A2>::type type; return __builtin_isunordered((type)__x, (type)__y); }