2
0
mirror of https://github.com/boostorg/math.git synced 2026-01-19 04:22:09 +00:00

Use is_policy for SFINAE

This commit is contained in:
Matt Borland
2025-09-09 08:28:47 +02:00
parent 083051164a
commit 8c2c5beeaf
2 changed files with 4 additions and 4 deletions

View File

@@ -108,7 +108,7 @@ BOOST_MATH_GPU_ENABLED inline typename tools::promote_args<T1, T2>::type
static_cast<result_type>(x), static_cast<result_type>(y), policies::policy<>());
}
template <class T1, class T2, class Policy, boost::math::enable_if_t<!boost::math::numeric_limits<Policy>::is_specialized, bool>>
template <class T1, class T2, class Policy, boost::math::enable_if_t<policies::is_policy_v<Policy>, bool>>
BOOST_MATH_GPU_ENABLED inline typename tools::promote_args<T1, T2>::type
hypot(T1 x, T2 y, const Policy& pol)
{
@@ -117,7 +117,7 @@ BOOST_MATH_GPU_ENABLED inline typename tools::promote_args<T1, T2>::type
static_cast<result_type>(x), static_cast<result_type>(y), pol);
}
template <class T1, class T2, class T3, boost::math::enable_if_t<boost::math::numeric_limits<T3>::is_specialized, bool>>
template <class T1, class T2, class T3, boost::math::enable_if_t<!policies::is_policy_v<T3>, bool>>
BOOST_MATH_GPU_ENABLED inline tools::promote_args_t<T1, T2, T3>
hypot(T1 x, T2 y, T3 z)
{

View File

@@ -636,11 +636,11 @@ namespace boost
BOOST_MATH_GPU_ENABLED tools::promote_args_t<T1, T2>
hypot(T1 x, T2 y);
template <class T1, class T2, class Policy, boost::math::enable_if_t<!boost::math::numeric_limits<Policy>::is_specialized, bool> = true>
template <class T1, class T2, class Policy, boost::math::enable_if_t<policies::is_policy_v<Policy>, bool> = true>
BOOST_MATH_GPU_ENABLED tools::promote_args_t<T1, T2>
hypot(T1 x, T2 y, const Policy&);
template <class T1, class T2, class T3, boost::math::enable_if_t<boost::math::numeric_limits<T3>::is_specialized, bool> = true>
template <class T1, class T2, class T3, boost::math::enable_if_t<!policies::is_policy_v<T3>, bool> = true>
BOOST_MATH_GPU_ENABLED tools::promote_args_t<T1, T2, T3>
hypot(T1 x, T2 y, T3 z);