[libcxx-commits] [libcxx] f3589d2 - [libc++][NFC] Refactor the enable_ifs in the math headers
Nikolas Klauser via libcxx-commits
libcxx-commits at lists.llvm.org
Wed Aug 2 10:03:39 PDT 2023
Author: Nikolas Klauser
Date: 2023-08-02T10:03:32-07:00
New Revision: f3589d25fe09a9ec5d05d9ac389109a94f3f6187
URL: https://github.com/llvm/llvm-project/commit/f3589d25fe09a9ec5d05d9ac389109a94f3f6187
DIFF: https://github.com/llvm/llvm-project/commit/f3589d25fe09a9ec5d05d9ac389109a94f3f6187.diff
LOG: [libc++][NFC] Refactor the enable_ifs in the math headers
Reviewed By: #libc, Mordante
Spies: Mordante, libcxx-commits
Differential Revision: https://reviews.llvm.org/D155261
Added:
Modified:
libcxx/include/__math/abs.h
libcxx/include/__math/copysign.h
libcxx/include/__math/error_functions.h
libcxx/include/__math/exponential_functions.h
libcxx/include/__math/fdim.h
libcxx/include/__math/fma.h
libcxx/include/__math/gamma.h
libcxx/include/__math/hyperbolic_functions.h
libcxx/include/__math/hypot.h
libcxx/include/__math/inverse_hyperbolic_functions.h
libcxx/include/__math/inverse_trigonometric_functions.h
libcxx/include/__math/logarithms.h
libcxx/include/__math/min_max.h
libcxx/include/__math/modulo.h
libcxx/include/__math/remainder.h
libcxx/include/__math/roots.h
libcxx/include/__math/rounding_functions.h
libcxx/include/__math/traits.h
libcxx/include/__math/trigonometric_functions.h
Removed:
################################################################################
diff --git a/libcxx/include/__math/abs.h b/libcxx/include/__math/abs.h
index 32b6bd95cac987..6004690f4c4f4c 100644
--- a/libcxx/include/__math/abs.h
+++ b/libcxx/include/__math/abs.h
@@ -34,9 +34,8 @@ _LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI long double fabs(long double
return __builtin_fabsl(__x);
}
-template <class _A1>
-_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI typename enable_if<is_integral<_A1>::value, double>::type
-fabs(_A1 __x) _NOEXCEPT {
+template <class _A1, __enable_if_t<is_integral<_A1>::value, int> = 0>
+_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI double fabs(_A1 __x) _NOEXCEPT {
return __builtin_fabs((double)__x);
}
diff --git a/libcxx/include/__math/copysign.h b/libcxx/include/__math/copysign.h
index 1835fd277846ca..2219297e8b8c1e 100644
--- a/libcxx/include/__math/copysign.h
+++ b/libcxx/include/__math/copysign.h
@@ -33,10 +33,9 @@ _LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI long double copysign(long dou
return ::__builtin_copysignl(__x, __y);
}
-template <class _A1, class _A2>
-_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI
- typename __enable_if_t< is_arithmetic<_A1>::value && is_arithmetic<_A2>::value, __promote<_A1, _A2> >::type
- copysign(_A1 __x, _A2 __y) _NOEXCEPT {
+template <class _A1, class _A2, __enable_if_t<is_arithmetic<_A1>::value && is_arithmetic<_A2>::value, int> = 0>
+_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI typename __promote<_A1, _A2>::type
+copysign(_A1 __x, _A2 __y) _NOEXCEPT {
return ::__builtin_copysign(__x, __y);
}
diff --git a/libcxx/include/__math/error_functions.h b/libcxx/include/__math/error_functions.h
index 77d3635a3cf868..6b528bb290001a 100644
--- a/libcxx/include/__math/error_functions.h
+++ b/libcxx/include/__math/error_functions.h
@@ -32,8 +32,8 @@ _LIBCPP_HIDE_FROM_ABI double erf(double __x) _NOEXCEPT {
inline _LIBCPP_HIDE_FROM_ABI long double erf(long double __x) _NOEXCEPT { return __builtin_erfl(__x); }
-template <class _A1>
-inline _LIBCPP_HIDE_FROM_ABI typename enable_if<is_integral<_A1>::value, double>::type erf(_A1 __x) _NOEXCEPT {
+template <class _A1, __enable_if_t<is_integral<_A1>::value, int> = 0>
+inline _LIBCPP_HIDE_FROM_ABI double erf(_A1 __x) _NOEXCEPT {
return __builtin_erf((double)__x);
}
@@ -48,8 +48,8 @@ _LIBCPP_HIDE_FROM_ABI double erfc(double __x) _NOEXCEPT {
inline _LIBCPP_HIDE_FROM_ABI long double erfc(long double __x) _NOEXCEPT { return __builtin_erfcl(__x); }
-template <class _A1>
-inline _LIBCPP_HIDE_FROM_ABI typename enable_if<is_integral<_A1>::value, double>::type erfc(_A1 __x) _NOEXCEPT {
+template <class _A1, __enable_if_t<is_integral<_A1>::value, int> = 0>
+inline _LIBCPP_HIDE_FROM_ABI double erfc(_A1 __x) _NOEXCEPT {
return __builtin_erfc((double)__x);
}
diff --git a/libcxx/include/__math/exponential_functions.h b/libcxx/include/__math/exponential_functions.h
index a107aebc99ffa9..741347899c7dd8 100644
--- a/libcxx/include/__math/exponential_functions.h
+++ b/libcxx/include/__math/exponential_functions.h
@@ -35,8 +35,8 @@ _LIBCPP_HIDE_FROM_ABI double exp(double __x) _NOEXCEPT {
inline _LIBCPP_HIDE_FROM_ABI long double exp(long double __x) _NOEXCEPT { return __builtin_expl(__x); }
-template <class _A1>
-inline _LIBCPP_HIDE_FROM_ABI typename enable_if<is_integral<_A1>::value, double>::type exp(_A1 __x) _NOEXCEPT {
+template <class _A1, __enable_if_t<is_integral<_A1>::value, int> = 0>
+inline _LIBCPP_HIDE_FROM_ABI double exp(_A1 __x) _NOEXCEPT {
return __builtin_exp((double)__x);
}
@@ -53,9 +53,8 @@ inline _LIBCPP_HIDE_FROM_ABI long double frexp(long double __x, int* __e) _NOEXC
return __builtin_frexpl(__x, __e);
}
-template <class _A1>
-inline _LIBCPP_HIDE_FROM_ABI typename enable_if<is_integral<_A1>::value, double>::type
-frexp(_A1 __x, int* __e) _NOEXCEPT {
+template <class _A1, __enable_if_t<is_integral<_A1>::value, int> = 0>
+inline _LIBCPP_HIDE_FROM_ABI double frexp(_A1 __x, int* __e) _NOEXCEPT {
return __builtin_frexp((double)__x, __e);
}
@@ -72,9 +71,8 @@ inline _LIBCPP_HIDE_FROM_ABI long double ldexp(long double __x, int __e) _NOEXCE
return __builtin_ldexpl(__x, __e);
}
-template <class _A1>
-inline _LIBCPP_HIDE_FROM_ABI typename enable_if<is_integral<_A1>::value, double>::type
-ldexp(_A1 __x, int __e) _NOEXCEPT {
+template <class _A1, __enable_if_t<is_integral<_A1>::value, int> = 0>
+inline _LIBCPP_HIDE_FROM_ABI double ldexp(_A1 __x, int __e) _NOEXCEPT {
return __builtin_ldexp((double)__x, __e);
}
@@ -89,8 +87,8 @@ _LIBCPP_HIDE_FROM_ABI double exp2(double __x) _NOEXCEPT {
inline _LIBCPP_HIDE_FROM_ABI long double exp2(long double __x) _NOEXCEPT { return __builtin_exp2l(__x); }
-template <class _A1>
-inline _LIBCPP_HIDE_FROM_ABI typename enable_if<is_integral<_A1>::value, double>::type exp2(_A1 __x) _NOEXCEPT {
+template <class _A1, __enable_if_t<is_integral<_A1>::value, int> = 0>
+inline _LIBCPP_HIDE_FROM_ABI double exp2(_A1 __x) _NOEXCEPT {
return __builtin_exp2((double)__x);
}
@@ -105,8 +103,8 @@ _LIBCPP_HIDE_FROM_ABI double expm1(double __x) _NOEXCEPT {
inline _LIBCPP_HIDE_FROM_ABI long double expm1(long double __x) _NOEXCEPT { return __builtin_expm1l(__x); }
-template <class _A1>
-inline _LIBCPP_HIDE_FROM_ABI typename enable_if<is_integral<_A1>::value, double>::type expm1(_A1 __x) _NOEXCEPT {
+template <class _A1, __enable_if_t<is_integral<_A1>::value, int> = 0>
+inline _LIBCPP_HIDE_FROM_ABI double expm1(_A1 __x) _NOEXCEPT {
return __builtin_expm1((double)__x);
}
@@ -123,9 +121,8 @@ inline _LIBCPP_HIDE_FROM_ABI long double scalbln(long double __x, long __y) _NOE
return __builtin_scalblnl(__x, __y);
}
-template <class _A1>
-inline _LIBCPP_HIDE_FROM_ABI typename enable_if<is_integral<_A1>::value, double>::type
-scalbln(_A1 __x, long __y) _NOEXCEPT {
+template <class _A1, __enable_if_t<is_integral<_A1>::value, int> = 0>
+inline _LIBCPP_HIDE_FROM_ABI double scalbln(_A1 __x, long __y) _NOEXCEPT {
return __builtin_scalbln((double)__x, __y);
}
@@ -142,9 +139,8 @@ inline _LIBCPP_HIDE_FROM_ABI long double scalbn(long double __x, int __y) _NOEXC
return __builtin_scalbnl(__x, __y);
}
-template <class _A1>
-inline _LIBCPP_HIDE_FROM_ABI typename enable_if<is_integral<_A1>::value, double>::type
-scalbn(_A1 __x, int __y) _NOEXCEPT {
+template <class _A1, __enable_if_t<is_integral<_A1>::value, int> = 0>
+inline _LIBCPP_HIDE_FROM_ABI double scalbn(_A1 __x, int __y) _NOEXCEPT {
return __builtin_scalbn((double)__x, __y);
}
@@ -161,10 +157,8 @@ inline _LIBCPP_HIDE_FROM_ABI long double pow(long double __x, long double __y) _
return __builtin_powl(__x, __y);
}
-template <class _A1, class _A2>
-inline _LIBCPP_HIDE_FROM_ABI
- typename __enable_if_t< is_arithmetic<_A1>::value && is_arithmetic<_A2>::value, __promote<_A1, _A2> >::type
- pow(_A1 __x, _A2 __y) _NOEXCEPT {
+template <class _A1, class _A2, __enable_if_t<is_arithmetic<_A1>::value && is_arithmetic<_A2>::value, int> = 0>
+inline _LIBCPP_HIDE_FROM_ABI typename __promote<_A1, _A2>::type pow(_A1 __x, _A2 __y) _NOEXCEPT {
typedef typename __promote<_A1, _A2>::type __result_type;
static_assert((!(_IsSame<_A1, __result_type>::value && _IsSame<_A2, __result_type>::value)), "");
return __math::pow((__result_type)__x, (__result_type)__y);
diff --git a/libcxx/include/__math/fdim.h b/libcxx/include/__math/fdim.h
index 1864f305cb05ed..175427e57e8ce0 100644
--- a/libcxx/include/__math/fdim.h
+++ b/libcxx/include/__math/fdim.h
@@ -34,10 +34,8 @@ inline _LIBCPP_HIDE_FROM_ABI long double fdim(long double __x, long double __y)
return __builtin_fdiml(__x, __y);
}
-template <class _A1, class _A2>
-inline _LIBCPP_HIDE_FROM_ABI
- typename __enable_if_t< is_arithmetic<_A1>::value && is_arithmetic<_A2>::value, __promote<_A1, _A2> >::type
- fdim(_A1 __x, _A2 __y) _NOEXCEPT {
+template <class _A1, class _A2, __enable_if_t<is_arithmetic<_A1>::value && is_arithmetic<_A2>::value, int> = 0>
+inline _LIBCPP_HIDE_FROM_ABI typename __promote<_A1, _A2>::type fdim(_A1 __x, _A2 __y) _NOEXCEPT {
typedef typename __promote<_A1, _A2>::type __result_type;
static_assert((!(_IsSame<_A1, __result_type>::value && _IsSame<_A2, __result_type>::value)), "");
return __math::fdim((__result_type)__x, (__result_type)__y);
diff --git a/libcxx/include/__math/fma.h b/libcxx/include/__math/fma.h
index e988e08921257c..4fa68e9b100b1c 100644
--- a/libcxx/include/__math/fma.h
+++ b/libcxx/include/__math/fma.h
@@ -36,11 +36,11 @@ inline _LIBCPP_HIDE_FROM_ABI long double fma(long double __x, long double __y, l
return __builtin_fmal(__x, __y, __z);
}
-template <class _A1, class _A2, class _A3>
-inline _LIBCPP_HIDE_FROM_ABI
- typename __enable_if_t< is_arithmetic<_A1>::value && is_arithmetic<_A2>::value && is_arithmetic<_A3>::value,
- __promote<_A1, _A2, _A3> >::type
- fma(_A1 __x, _A2 __y, _A3 __z) _NOEXCEPT {
+template <class _A1,
+ class _A2,
+ class _A3,
+ __enable_if_t<is_arithmetic<_A1>::value && is_arithmetic<_A2>::value && is_arithmetic<_A3>::value, int> = 0>
+inline _LIBCPP_HIDE_FROM_ABI typename __promote<_A1, _A2, _A3>::type fma(_A1 __x, _A2 __y, _A3 __z) _NOEXCEPT {
typedef typename __promote<_A1, _A2, _A3>::type __result_type;
static_assert((!(_IsSame<_A1, __result_type>::value && _IsSame<_A2, __result_type>::value &&
_IsSame<_A3, __result_type>::value)),
diff --git a/libcxx/include/__math/gamma.h b/libcxx/include/__math/gamma.h
index 0ef03342fb3fd2..693e111a84e99d 100644
--- a/libcxx/include/__math/gamma.h
+++ b/libcxx/include/__math/gamma.h
@@ -32,8 +32,8 @@ _LIBCPP_HIDE_FROM_ABI double lgamma(double __x) _NOEXCEPT {
inline _LIBCPP_HIDE_FROM_ABI long double lgamma(long double __x) _NOEXCEPT { return __builtin_lgammal(__x); }
-template <class _A1>
-inline _LIBCPP_HIDE_FROM_ABI typename enable_if<is_integral<_A1>::value, double>::type lgamma(_A1 __x) _NOEXCEPT {
+template <class _A1, __enable_if_t<is_integral<_A1>::value, int> = 0>
+inline _LIBCPP_HIDE_FROM_ABI double lgamma(_A1 __x) _NOEXCEPT {
return __builtin_lgamma((double)__x);
}
@@ -50,8 +50,8 @@ _LIBCPP_HIDE_FROM_ABI double tgamma(double __x) _NOEXCEPT {
inline _LIBCPP_HIDE_FROM_ABI long double tgamma(long double __x) _NOEXCEPT { return __builtin_tgammal(__x); }
-template <class _A1>
-inline _LIBCPP_HIDE_FROM_ABI typename enable_if<is_integral<_A1>::value, double>::type tgamma(_A1 __x) _NOEXCEPT {
+template <class _A1, __enable_if_t<is_integral<_A1>::value, int> = 0>
+inline _LIBCPP_HIDE_FROM_ABI double tgamma(_A1 __x) _NOEXCEPT {
return __builtin_tgamma((double)__x);
}
diff --git a/libcxx/include/__math/hyperbolic_functions.h b/libcxx/include/__math/hyperbolic_functions.h
index b8b64a4cd59851..78832bae70c9d1 100644
--- a/libcxx/include/__math/hyperbolic_functions.h
+++ b/libcxx/include/__math/hyperbolic_functions.h
@@ -32,8 +32,8 @@ _LIBCPP_HIDE_FROM_ABI double cosh(double __x) _NOEXCEPT {
inline _LIBCPP_HIDE_FROM_ABI long double cosh(long double __x) _NOEXCEPT { return __builtin_coshl(__x); }
-template <class _A1>
-inline _LIBCPP_HIDE_FROM_ABI typename enable_if<is_integral<_A1>::value, double>::type cosh(_A1 __x) _NOEXCEPT {
+template <class _A1, __enable_if_t<is_integral<_A1>::value, int> = 0>
+inline _LIBCPP_HIDE_FROM_ABI double cosh(_A1 __x) _NOEXCEPT {
return __builtin_cosh((double)__x);
}
@@ -48,8 +48,8 @@ _LIBCPP_HIDE_FROM_ABI double sinh(double __x) _NOEXCEPT {
inline _LIBCPP_HIDE_FROM_ABI long double sinh(long double __x) _NOEXCEPT { return __builtin_sinhl(__x); }
-template <class _A1>
-inline _LIBCPP_HIDE_FROM_ABI typename enable_if<is_integral<_A1>::value, double>::type sinh(_A1 __x) _NOEXCEPT {
+template <class _A1, __enable_if_t<is_integral<_A1>::value, int> = 0>
+inline _LIBCPP_HIDE_FROM_ABI double sinh(_A1 __x) _NOEXCEPT {
return __builtin_sinh((double)__x);
}
@@ -64,8 +64,8 @@ _LIBCPP_HIDE_FROM_ABI double tanh(double __x) _NOEXCEPT {
inline _LIBCPP_HIDE_FROM_ABI long double tanh(long double __x) _NOEXCEPT { return __builtin_tanhl(__x); }
-template <class _A1>
-inline _LIBCPP_HIDE_FROM_ABI typename enable_if<is_integral<_A1>::value, double>::type tanh(_A1 __x) _NOEXCEPT {
+template <class _A1, __enable_if_t<is_integral<_A1>::value, int> = 0>
+inline _LIBCPP_HIDE_FROM_ABI double tanh(_A1 __x) _NOEXCEPT {
return __builtin_tanh((double)__x);
}
diff --git a/libcxx/include/__math/hypot.h b/libcxx/include/__math/hypot.h
index 22420b7d11da6e..8d740faac6e27c 100644
--- a/libcxx/include/__math/hypot.h
+++ b/libcxx/include/__math/hypot.h
@@ -34,10 +34,8 @@ inline _LIBCPP_HIDE_FROM_ABI long double hypot(long double __x, long double __y)
return __builtin_hypotl(__x, __y);
}
-template <class _A1, class _A2>
-inline _LIBCPP_HIDE_FROM_ABI
- typename __enable_if_t< is_arithmetic<_A1>::value && is_arithmetic<_A2>::value, __promote<_A1, _A2> >::type
- hypot(_A1 __x, _A2 __y) _NOEXCEPT {
+template <class _A1, class _A2, __enable_if_t<is_arithmetic<_A1>::value && is_arithmetic<_A2>::value, int> = 0>
+inline _LIBCPP_HIDE_FROM_ABI typename __promote<_A1, _A2>::type hypot(_A1 __x, _A2 __y) _NOEXCEPT {
typedef typename __promote<_A1, _A2>::type __result_type;
static_assert((!(_IsSame<_A1, __result_type>::value && _IsSame<_A2, __result_type>::value)), "");
return __math::hypot((__result_type)__x, (__result_type)__y);
diff --git a/libcxx/include/__math/inverse_hyperbolic_functions.h b/libcxx/include/__math/inverse_hyperbolic_functions.h
index c3ec064643e834..4660a58e4eba02 100644
--- a/libcxx/include/__math/inverse_hyperbolic_functions.h
+++ b/libcxx/include/__math/inverse_hyperbolic_functions.h
@@ -32,8 +32,8 @@ _LIBCPP_HIDE_FROM_ABI double acosh(double __x) _NOEXCEPT {
inline _LIBCPP_HIDE_FROM_ABI long double acosh(long double __x) _NOEXCEPT { return __builtin_acoshl(__x); }
-template <class _A1>
-inline _LIBCPP_HIDE_FROM_ABI typename enable_if<is_integral<_A1>::value, double>::type acosh(_A1 __x) _NOEXCEPT {
+template <class _A1, __enable_if_t<is_integral<_A1>::value, int> = 0>
+inline _LIBCPP_HIDE_FROM_ABI double acosh(_A1 __x) _NOEXCEPT {
return __builtin_acosh((double)__x);
}
@@ -48,8 +48,8 @@ _LIBCPP_HIDE_FROM_ABI double asinh(double __x) _NOEXCEPT {
inline _LIBCPP_HIDE_FROM_ABI long double asinh(long double __x) _NOEXCEPT { return __builtin_asinhl(__x); }
-template <class _A1>
-inline _LIBCPP_HIDE_FROM_ABI typename enable_if<is_integral<_A1>::value, double>::type asinh(_A1 __x) _NOEXCEPT {
+template <class _A1, __enable_if_t<is_integral<_A1>::value, int> = 0>
+inline _LIBCPP_HIDE_FROM_ABI double asinh(_A1 __x) _NOEXCEPT {
return __builtin_asinh((double)__x);
}
@@ -64,8 +64,8 @@ _LIBCPP_HIDE_FROM_ABI double atanh(double __x) _NOEXCEPT {
inline _LIBCPP_HIDE_FROM_ABI long double atanh(long double __x) _NOEXCEPT { return __builtin_atanhl(__x); }
-template <class _A1>
-inline _LIBCPP_HIDE_FROM_ABI typename enable_if<is_integral<_A1>::value, double>::type atanh(_A1 __x) _NOEXCEPT {
+template <class _A1, __enable_if_t<is_integral<_A1>::value, int> = 0>
+inline _LIBCPP_HIDE_FROM_ABI double atanh(_A1 __x) _NOEXCEPT {
return __builtin_atanh((double)__x);
}
diff --git a/libcxx/include/__math/inverse_trigonometric_functions.h b/libcxx/include/__math/inverse_trigonometric_functions.h
index 411d35a17acb7e..16fb929eebc5aa 100644
--- a/libcxx/include/__math/inverse_trigonometric_functions.h
+++ b/libcxx/include/__math/inverse_trigonometric_functions.h
@@ -35,8 +35,8 @@ _LIBCPP_HIDE_FROM_ABI double acos(double __x) _NOEXCEPT {
inline _LIBCPP_HIDE_FROM_ABI long double acos(long double __x) _NOEXCEPT { return __builtin_acosl(__x); }
-template <class _A1>
-inline _LIBCPP_HIDE_FROM_ABI typename enable_if<is_integral<_A1>::value, double>::type acos(_A1 __x) _NOEXCEPT {
+template <class _A1, __enable_if_t<is_integral<_A1>::value, int> = 0>
+inline _LIBCPP_HIDE_FROM_ABI double acos(_A1 __x) _NOEXCEPT {
return __builtin_acos((double)__x);
}
@@ -51,8 +51,8 @@ _LIBCPP_HIDE_FROM_ABI double asin(double __x) _NOEXCEPT {
inline _LIBCPP_HIDE_FROM_ABI long double asin(long double __x) _NOEXCEPT { return __builtin_asinl(__x); }
-template <class _A1>
-inline _LIBCPP_HIDE_FROM_ABI typename enable_if<is_integral<_A1>::value, double>::type asin(_A1 __x) _NOEXCEPT {
+template <class _A1, __enable_if_t<is_integral<_A1>::value, int> = 0>
+inline _LIBCPP_HIDE_FROM_ABI double asin(_A1 __x) _NOEXCEPT {
return __builtin_asin((double)__x);
}
@@ -67,8 +67,8 @@ _LIBCPP_HIDE_FROM_ABI double atan(double __x) _NOEXCEPT {
inline _LIBCPP_HIDE_FROM_ABI long double atan(long double __x) _NOEXCEPT { return __builtin_atanl(__x); }
-template <class _A1>
-inline _LIBCPP_HIDE_FROM_ABI typename enable_if<is_integral<_A1>::value, double>::type atan(_A1 __x) _NOEXCEPT {
+template <class _A1, __enable_if_t<is_integral<_A1>::value, int> = 0>
+inline _LIBCPP_HIDE_FROM_ABI double atan(_A1 __x) _NOEXCEPT {
return __builtin_atan((double)__x);
}
@@ -85,10 +85,8 @@ inline _LIBCPP_HIDE_FROM_ABI long double atan2(long double __y, long double __x)
return __builtin_atan2l(__y, __x);
}
-template <class _A1, class _A2>
-inline _LIBCPP_HIDE_FROM_ABI
- typename __enable_if_t< is_arithmetic<_A1>::value && is_arithmetic<_A2>::value, __promote<_A1, _A2> >::type
- atan2(_A1 __y, _A2 __x) _NOEXCEPT {
+template <class _A1, class _A2, __enable_if_t<is_arithmetic<_A1>::value && is_arithmetic<_A2>::value, int> = 0>
+inline _LIBCPP_HIDE_FROM_ABI typename __promote<_A1, _A2>::type atan2(_A1 __y, _A2 __x) _NOEXCEPT {
typedef typename __promote<_A1, _A2>::type __result_type;
static_assert((!(_IsSame<_A1, __result_type>::value && _IsSame<_A2, __result_type>::value)), "");
return __math::atan2((__result_type)__y, (__result_type)__x);
diff --git a/libcxx/include/__math/logarithms.h b/libcxx/include/__math/logarithms.h
index 5883aaed380b59..5f5f943977a508 100644
--- a/libcxx/include/__math/logarithms.h
+++ b/libcxx/include/__math/logarithms.h
@@ -32,8 +32,8 @@ _LIBCPP_HIDE_FROM_ABI double log(double __x) _NOEXCEPT {
inline _LIBCPP_HIDE_FROM_ABI long double log(long double __x) _NOEXCEPT { return __builtin_logl(__x); }
-template <class _A1>
-inline _LIBCPP_HIDE_FROM_ABI typename enable_if<is_integral<_A1>::value, double>::type log(_A1 __x) _NOEXCEPT {
+template <class _A1, __enable_if_t<is_integral<_A1>::value, int> = 0>
+inline _LIBCPP_HIDE_FROM_ABI double log(_A1 __x) _NOEXCEPT {
return __builtin_log((double)__x);
}
@@ -48,8 +48,8 @@ _LIBCPP_HIDE_FROM_ABI double log10(double __x) _NOEXCEPT {
inline _LIBCPP_HIDE_FROM_ABI long double log10(long double __x) _NOEXCEPT { return __builtin_log10l(__x); }
-template <class _A1>
-inline _LIBCPP_HIDE_FROM_ABI typename enable_if<is_integral<_A1>::value, double>::type log10(_A1 __x) _NOEXCEPT {
+template <class _A1, __enable_if_t<is_integral<_A1>::value, int> = 0>
+inline _LIBCPP_HIDE_FROM_ABI double log10(_A1 __x) _NOEXCEPT {
return __builtin_log10((double)__x);
}
@@ -64,8 +64,8 @@ _LIBCPP_HIDE_FROM_ABI double ilogb(double __x) _NOEXCEPT {
inline _LIBCPP_HIDE_FROM_ABI int ilogb(long double __x) _NOEXCEPT { return __builtin_ilogbl(__x); }
-template <class _A1>
-inline _LIBCPP_HIDE_FROM_ABI typename enable_if<is_integral<_A1>::value, int>::type ilogb(_A1 __x) _NOEXCEPT {
+template <class _A1, __enable_if_t<is_integral<_A1>::value, int> = 0>
+inline _LIBCPP_HIDE_FROM_ABI int ilogb(_A1 __x) _NOEXCEPT {
return __builtin_ilogb((double)__x);
}
@@ -80,8 +80,8 @@ _LIBCPP_HIDE_FROM_ABI double log1p(double __x) _NOEXCEPT {
inline _LIBCPP_HIDE_FROM_ABI long double log1p(long double __x) _NOEXCEPT { return __builtin_log1pl(__x); }
-template <class _A1>
-inline _LIBCPP_HIDE_FROM_ABI typename enable_if<is_integral<_A1>::value, double>::type log1p(_A1 __x) _NOEXCEPT {
+template <class _A1, __enable_if_t<is_integral<_A1>::value, int> = 0>
+inline _LIBCPP_HIDE_FROM_ABI double log1p(_A1 __x) _NOEXCEPT {
return __builtin_log1p((double)__x);
}
@@ -96,8 +96,8 @@ _LIBCPP_HIDE_FROM_ABI double log2(double __x) _NOEXCEPT {
inline _LIBCPP_HIDE_FROM_ABI long double log2(long double __x) _NOEXCEPT { return __builtin_log2l(__x); }
-template <class _A1>
-inline _LIBCPP_HIDE_FROM_ABI typename enable_if<is_integral<_A1>::value, double>::type log2(_A1 __x) _NOEXCEPT {
+template <class _A1, __enable_if_t<is_integral<_A1>::value, int> = 0>
+inline _LIBCPP_HIDE_FROM_ABI double log2(_A1 __x) _NOEXCEPT {
return __builtin_log2((double)__x);
}
@@ -112,8 +112,8 @@ _LIBCPP_HIDE_FROM_ABI double logb(double __x) _NOEXCEPT {
inline _LIBCPP_HIDE_FROM_ABI long double logb(long double __x) _NOEXCEPT { return __builtin_logbl(__x); }
-template <class _A1>
-inline _LIBCPP_HIDE_FROM_ABI typename enable_if<is_integral<_A1>::value, double>::type logb(_A1 __x) _NOEXCEPT {
+template <class _A1, __enable_if_t<is_integral<_A1>::value, int> = 0>
+inline _LIBCPP_HIDE_FROM_ABI double logb(_A1 __x) _NOEXCEPT {
return __builtin_logb((double)__x);
}
diff --git a/libcxx/include/__math/min_max.h b/libcxx/include/__math/min_max.h
index 33e9d597c2d443..8d06fba60958d7 100644
--- a/libcxx/include/__math/min_max.h
+++ b/libcxx/include/__math/min_max.h
@@ -38,10 +38,8 @@ _LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI long double fmax(long double
return __builtin_fmaxl(__x, __y);
}
-template <class _A1, class _A2>
-_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI
- typename __enable_if_t< is_arithmetic<_A1>::value && is_arithmetic<_A2>::value, __promote<_A1, _A2> >::type
- fmax(_A1 __x, _A2 __y) _NOEXCEPT {
+template <class _A1, class _A2, __enable_if_t<is_arithmetic<_A1>::value && is_arithmetic<_A2>::value, int> = 0>
+_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI typename __promote<_A1, _A2>::type fmax(_A1 __x, _A2 __y) _NOEXCEPT {
typedef typename __promote<_A1, _A2>::type __result_type;
static_assert((!(_IsSame<_A1, __result_type>::value && _IsSame<_A2, __result_type>::value)), "");
return __math::fmax((__result_type)__x, (__result_type)__y);
@@ -62,10 +60,8 @@ _LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI long double fmin(long double
return __builtin_fminl(__x, __y);
}
-template <class _A1, class _A2>
-_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI
- typename __enable_if_t< is_arithmetic<_A1>::value && is_arithmetic<_A2>::value, __promote<_A1, _A2> >::type
- fmin(_A1 __x, _A2 __y) _NOEXCEPT {
+template <class _A1, class _A2, __enable_if_t<is_arithmetic<_A1>::value && is_arithmetic<_A2>::value, int> = 0>
+_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI typename __promote<_A1, _A2>::type fmin(_A1 __x, _A2 __y) _NOEXCEPT {
typedef typename __promote<_A1, _A2>::type __result_type;
static_assert((!(_IsSame<_A1, __result_type>::value && _IsSame<_A2, __result_type>::value)), "");
return __math::fmin((__result_type)__x, (__result_type)__y);
diff --git a/libcxx/include/__math/modulo.h b/libcxx/include/__math/modulo.h
index fd54a4f2c18ff9..2783f845fe11c0 100644
--- a/libcxx/include/__math/modulo.h
+++ b/libcxx/include/__math/modulo.h
@@ -36,10 +36,8 @@ inline _LIBCPP_HIDE_FROM_ABI long double fmod(long double __x, long double __y)
return __builtin_fmodl(__x, __y);
}
-template <class _A1, class _A2>
-inline _LIBCPP_HIDE_FROM_ABI
- typename __enable_if_t< is_arithmetic<_A1>::value && is_arithmetic<_A2>::value, __promote<_A1, _A2> >::type
- fmod(_A1 __x, _A2 __y) _NOEXCEPT {
+template <class _A1, class _A2, __enable_if_t<is_arithmetic<_A1>::value && is_arithmetic<_A2>::value, int> = 0>
+inline _LIBCPP_HIDE_FROM_ABI typename __promote<_A1, _A2>::type fmod(_A1 __x, _A2 __y) _NOEXCEPT {
typedef typename __promote<_A1, _A2>::type __result_type;
static_assert((!(_IsSame<_A1, __result_type>::value && _IsSame<_A2, __result_type>::value)), "");
return __math::fmod((__result_type)__x, (__result_type)__y);
diff --git a/libcxx/include/__math/remainder.h b/libcxx/include/__math/remainder.h
index eba2b39ea1461e..de649b1f1f467f 100644
--- a/libcxx/include/__math/remainder.h
+++ b/libcxx/include/__math/remainder.h
@@ -37,10 +37,8 @@ inline _LIBCPP_HIDE_FROM_ABI long double remainder(long double __x, long double
return __builtin_remainderl(__x, __y);
}
-template <class _A1, class _A2>
-inline _LIBCPP_HIDE_FROM_ABI
- typename __enable_if_t< is_arithmetic<_A1>::value && is_arithmetic<_A2>::value, __promote<_A1, _A2> >::type
- remainder(_A1 __x, _A2 __y) _NOEXCEPT {
+template <class _A1, class _A2, __enable_if_t<is_arithmetic<_A1>::value && is_arithmetic<_A2>::value, int> = 0>
+inline _LIBCPP_HIDE_FROM_ABI typename __promote<_A1, _A2>::type remainder(_A1 __x, _A2 __y) _NOEXCEPT {
typedef typename __promote<_A1, _A2>::type __result_type;
static_assert((!(_IsSame<_A1, __result_type>::value && _IsSame<_A2, __result_type>::value)), "");
return __math::remainder((__result_type)__x, (__result_type)__y);
@@ -61,10 +59,8 @@ inline _LIBCPP_HIDE_FROM_ABI long double remquo(long double __x, long double __y
return __builtin_remquol(__x, __y, __z);
}
-template <class _A1, class _A2>
-inline _LIBCPP_HIDE_FROM_ABI
- typename __enable_if_t< is_arithmetic<_A1>::value && is_arithmetic<_A2>::value, __promote<_A1, _A2> >::type
- remquo(_A1 __x, _A2 __y, int* __z) _NOEXCEPT {
+template <class _A1, class _A2, __enable_if_t<is_arithmetic<_A1>::value && is_arithmetic<_A2>::value, int> = 0>
+inline _LIBCPP_HIDE_FROM_ABI typename __promote<_A1, _A2>::type remquo(_A1 __x, _A2 __y, int* __z) _NOEXCEPT {
typedef typename __promote<_A1, _A2>::type __result_type;
static_assert((!(_IsSame<_A1, __result_type>::value && _IsSame<_A2, __result_type>::value)), "");
return __math::remquo((__result_type)__x, (__result_type)__y, __z);
diff --git a/libcxx/include/__math/roots.h b/libcxx/include/__math/roots.h
index 4497c115e7ef99..faee688bc95b82 100644
--- a/libcxx/include/__math/roots.h
+++ b/libcxx/include/__math/roots.h
@@ -32,8 +32,8 @@ _LIBCPP_HIDE_FROM_ABI double sqrt(double __x) _NOEXCEPT {
inline _LIBCPP_HIDE_FROM_ABI long double sqrt(long double __x) _NOEXCEPT { return __builtin_sqrtl(__x); }
-template <class _A1>
-inline _LIBCPP_HIDE_FROM_ABI typename enable_if<is_integral<_A1>::value, double>::type sqrt(_A1 __x) _NOEXCEPT {
+template <class _A1, __enable_if_t<is_integral<_A1>::value, int> = 0>
+inline _LIBCPP_HIDE_FROM_ABI double sqrt(_A1 __x) _NOEXCEPT {
return __builtin_sqrt((double)__x);
}
@@ -50,9 +50,8 @@ _LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI long double cbrt(long double
return __builtin_cbrtl(__x);
}
-template <class _A1>
-_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI typename enable_if<is_integral<_A1>::value, double>::type
-cbrt(_A1 __x) _NOEXCEPT {
+template <class _A1, __enable_if_t<is_integral<_A1>::value, int> = 0>
+_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI double cbrt(_A1 __x) _NOEXCEPT {
return __builtin_cbrt((double)__x);
}
diff --git a/libcxx/include/__math/rounding_functions.h b/libcxx/include/__math/rounding_functions.h
index c27e8189043e08..dadb8a76390af2 100644
--- a/libcxx/include/__math/rounding_functions.h
+++ b/libcxx/include/__math/rounding_functions.h
@@ -37,9 +37,8 @@ _LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI long double ceil(long double
return __builtin_ceill(__x);
}
-template <class _A1>
-_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI typename enable_if<is_integral<_A1>::value, double>::type
-ceil(_A1 __x) _NOEXCEPT {
+template <class _A1, __enable_if_t<is_integral<_A1>::value, int> = 0>
+_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI double ceil(_A1 __x) _NOEXCEPT {
return __builtin_ceil((double)__x);
}
@@ -56,9 +55,8 @@ _LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI long double floor(long double
return __builtin_floorl(__x);
}
-template <class _A1>
-_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI typename enable_if<is_integral<_A1>::value, double>::type
-floor(_A1 __x) _NOEXCEPT {
+template <class _A1, __enable_if_t<is_integral<_A1>::value, int> = 0>
+_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI double floor(_A1 __x) _NOEXCEPT {
return __builtin_floor((double)__x);
}
@@ -73,8 +71,8 @@ _LIBCPP_HIDE_FROM_ABI long long llrint(double __x) _NOEXCEPT {
inline _LIBCPP_HIDE_FROM_ABI long long llrint(long double __x) _NOEXCEPT { return __builtin_llrintl(__x); }
-template <class _A1>
-inline _LIBCPP_HIDE_FROM_ABI typename enable_if<is_integral<_A1>::value, long long>::type llrint(_A1 __x) _NOEXCEPT {
+template <class _A1, __enable_if_t<is_integral<_A1>::value, int> = 0>
+inline _LIBCPP_HIDE_FROM_ABI long long llrint(_A1 __x) _NOEXCEPT {
return __builtin_llrint((double)__x);
}
@@ -89,8 +87,8 @@ _LIBCPP_HIDE_FROM_ABI long long llround(double __x) _NOEXCEPT {
inline _LIBCPP_HIDE_FROM_ABI long long llround(long double __x) _NOEXCEPT { return __builtin_llroundl(__x); }
-template <class _A1>
-inline _LIBCPP_HIDE_FROM_ABI typename enable_if<is_integral<_A1>::value, long long>::type llround(_A1 __x) _NOEXCEPT {
+template <class _A1, __enable_if_t<is_integral<_A1>::value, int> = 0>
+inline _LIBCPP_HIDE_FROM_ABI long long llround(_A1 __x) _NOEXCEPT {
return __builtin_llround((double)__x);
}
@@ -105,8 +103,8 @@ _LIBCPP_HIDE_FROM_ABI long lrint(double __x) _NOEXCEPT {
inline _LIBCPP_HIDE_FROM_ABI long lrint(long double __x) _NOEXCEPT { return __builtin_lrintl(__x); }
-template <class _A1>
-inline _LIBCPP_HIDE_FROM_ABI typename enable_if<is_integral<_A1>::value, long>::type lrint(_A1 __x) _NOEXCEPT {
+template <class _A1, __enable_if_t<is_integral<_A1>::value, int> = 0>
+inline _LIBCPP_HIDE_FROM_ABI long lrint(_A1 __x) _NOEXCEPT {
return __builtin_lrint((double)__x);
}
@@ -121,8 +119,8 @@ _LIBCPP_HIDE_FROM_ABI long lround(double __x) _NOEXCEPT {
inline _LIBCPP_HIDE_FROM_ABI long lround(long double __x) _NOEXCEPT { return __builtin_lroundl(__x); }
-template <class _A1>
-inline _LIBCPP_HIDE_FROM_ABI typename enable_if<is_integral<_A1>::value, long>::type lround(_A1 __x) _NOEXCEPT {
+template <class _A1, __enable_if_t<is_integral<_A1>::value, int> = 0>
+inline _LIBCPP_HIDE_FROM_ABI long lround(_A1 __x) _NOEXCEPT {
return __builtin_lround((double)__x);
}
@@ -141,9 +139,8 @@ _LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI long double nearbyint(long do
return __builtin_nearbyintl(__x);
}
-template <class _A1>
-_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI typename enable_if<is_integral<_A1>::value, double>::type
-nearbyint(_A1 __x) _NOEXCEPT {
+template <class _A1, __enable_if_t<is_integral<_A1>::value, int> = 0>
+_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI double nearbyint(_A1 __x) _NOEXCEPT {
return __builtin_nearbyint((double)__x);
}
@@ -160,10 +157,8 @@ inline _LIBCPP_HIDE_FROM_ABI long double nextafter(long double __x, long double
return __builtin_nextafterl(__x, __y);
}
-template <class _A1, class _A2>
-inline _LIBCPP_HIDE_FROM_ABI
- typename __enable_if_t< is_arithmetic<_A1>::value && is_arithmetic<_A2>::value, __promote<_A1, _A2> >::type
- nextafter(_A1 __x, _A2 __y) _NOEXCEPT {
+template <class _A1, class _A2, __enable_if_t<is_arithmetic<_A1>::value && is_arithmetic<_A2>::value, int> = 0>
+inline _LIBCPP_HIDE_FROM_ABI typename __promote<_A1, _A2>::type nextafter(_A1 __x, _A2 __y) _NOEXCEPT {
typedef typename __promote<_A1, _A2>::type __result_type;
static_assert((!(_IsSame<_A1, __result_type>::value && _IsSame<_A2, __result_type>::value)), "");
return __math::nextafter((__result_type)__x, (__result_type)__y);
@@ -184,9 +179,8 @@ inline _LIBCPP_HIDE_FROM_ABI long double nexttoward(long double __x, long double
return __builtin_nexttowardl(__x, __y);
}
-template <class _A1>
-inline _LIBCPP_HIDE_FROM_ABI typename enable_if<is_integral<_A1>::value, double>::type
-nexttoward(_A1 __x, long double __y) _NOEXCEPT {
+template <class _A1, __enable_if_t<is_integral<_A1>::value, int> = 0>
+inline _LIBCPP_HIDE_FROM_ABI double nexttoward(_A1 __x, long double __y) _NOEXCEPT {
return __builtin_nexttoward((double)__x, __y);
}
@@ -203,9 +197,8 @@ _LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI long double rint(long double
return __builtin_rintl(__x);
}
-template <class _A1>
-_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI typename enable_if<is_integral<_A1>::value, double>::type
-rint(_A1 __x) _NOEXCEPT {
+template <class _A1, __enable_if_t<is_integral<_A1>::value, int> = 0>
+_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI double rint(_A1 __x) _NOEXCEPT {
return __builtin_rint((double)__x);
}
@@ -222,9 +215,8 @@ _LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI long double round(long double
return __builtin_roundl(__x);
}
-template <class _A1>
-_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI typename enable_if<is_integral<_A1>::value, double>::type
-round(_A1 __x) _NOEXCEPT {
+template <class _A1, __enable_if_t<is_integral<_A1>::value, int> = 0>
+_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI double round(_A1 __x) _NOEXCEPT {
return __builtin_round((double)__x);
}
@@ -241,9 +233,8 @@ _LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI long double trunc(long double
return __builtin_truncl(__x);
}
-template <class _A1>
-_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI typename enable_if<is_integral<_A1>::value, double>::type
-trunc(_A1 __x) _NOEXCEPT {
+template <class _A1, __enable_if_t<is_integral<_A1>::value, int> = 0>
+_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI double trunc(_A1 __x) _NOEXCEPT {
return __builtin_trunc((double)__x);
}
diff --git a/libcxx/include/__math/traits.h b/libcxx/include/__math/traits.h
index d5e0c837da5ae5..8b3ce2a1e43971 100644
--- a/libcxx/include/__math/traits.h
+++ b/libcxx/include/__math/traits.h
@@ -62,10 +62,8 @@ _LIBCPP_NODISCARD_EXT _LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI bool i
return __builtin_isinf((typename __promote<_A1>::type)__x);
}
-template <class _A1>
-_LIBCPP_NODISCARD_EXT _LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI
- typename enable_if< is_arithmetic<_A1>::value && !numeric_limits<_A1>::has_infinity, bool>::type
- isinf(_A1) _NOEXCEPT {
+template <class _A1, __enable_if_t<is_arithmetic<_A1>::value && !numeric_limits<_A1>::has_infinity, int> = 0>
+_LIBCPP_NODISCARD_EXT _LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI bool isinf(_A1) _NOEXCEPT {
return false;
}
diff --git a/libcxx/include/__math/trigonometric_functions.h b/libcxx/include/__math/trigonometric_functions.h
index 468ac1727f72a0..0ad91c76316091 100644
--- a/libcxx/include/__math/trigonometric_functions.h
+++ b/libcxx/include/__math/trigonometric_functions.h
@@ -32,8 +32,8 @@ _LIBCPP_HIDE_FROM_ABI double cos(double __x) _NOEXCEPT {
inline _LIBCPP_HIDE_FROM_ABI long double cos(long double __x) _NOEXCEPT { return __builtin_cosl(__x); }
-template <class _A1>
-inline _LIBCPP_HIDE_FROM_ABI typename enable_if<is_integral<_A1>::value, double>::type cos(_A1 __x) _NOEXCEPT {
+template <class _A1, __enable_if_t<is_integral<_A1>::value, int> = 0>
+inline _LIBCPP_HIDE_FROM_ABI double cos(_A1 __x) _NOEXCEPT {
return __builtin_cos((double)__x);
}
@@ -48,8 +48,8 @@ _LIBCPP_HIDE_FROM_ABI double sin(double __x) _NOEXCEPT {
inline _LIBCPP_HIDE_FROM_ABI long double sin(long double __x) _NOEXCEPT { return __builtin_sinl(__x); }
-template <class _A1>
-inline _LIBCPP_HIDE_FROM_ABI typename enable_if<is_integral<_A1>::value, double>::type sin(_A1 __x) _NOEXCEPT {
+template <class _A1, __enable_if_t<is_integral<_A1>::value, int> = 0>
+inline _LIBCPP_HIDE_FROM_ABI double sin(_A1 __x) _NOEXCEPT {
return __builtin_sin((double)__x);
}
@@ -64,8 +64,8 @@ _LIBCPP_HIDE_FROM_ABI double tan(double __x) _NOEXCEPT {
inline _LIBCPP_HIDE_FROM_ABI long double tan(long double __x) _NOEXCEPT { return __builtin_tanl(__x); }
-template <class _A1>
-inline _LIBCPP_HIDE_FROM_ABI typename enable_if<is_integral<_A1>::value, double>::type tan(_A1 __x) _NOEXCEPT {
+template <class _A1, __enable_if_t<is_integral<_A1>::value, int> = 0>
+inline _LIBCPP_HIDE_FROM_ABI double tan(_A1 __x) _NOEXCEPT {
return __builtin_tan((double)__x);
}
More information about the libcxx-commits
mailing list