From fb5641a80a826d73bb73e51d93a1e0742ae3598f Mon Sep 17 00:00:00 2001 From: Matt Borland Date: Mon, 8 Sep 2025 13:25:33 +0200 Subject: [PATCH] Fix SFINAE for 2-arg + policy and 3 arg w/o policy --- include/boost/math/special_functions/hypot.hpp | 5 +++-- include/boost/math/special_functions/math_fwd.hpp | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/include/boost/math/special_functions/hypot.hpp b/include/boost/math/special_functions/hypot.hpp index d7319de58..c06dfa4c0 100644 --- a/include/boost/math/special_functions/hypot.hpp +++ b/include/boost/math/special_functions/hypot.hpp @@ -17,6 +17,7 @@ #include #include #include +#include namespace boost{ namespace math{ namespace detail{ @@ -101,7 +102,7 @@ BOOST_MATH_GPU_ENABLED inline typename tools::promote_args::type static_cast(x), static_cast(y), policies::policy<>()); } -template +template ::is_specialized, bool>> BOOST_MATH_GPU_ENABLED inline typename tools::promote_args::type hypot(T1 x, T2 y, const Policy& pol) { @@ -110,7 +111,7 @@ BOOST_MATH_GPU_ENABLED inline typename tools::promote_args::type static_cast(x), static_cast(y), pol); } -template ::value, bool> = true> +template ::is_specialized, bool>> BOOST_MATH_GPU_ENABLED tools::promote_args_t hypot(T1 x, T2 y, T3 z) { diff --git a/include/boost/math/special_functions/math_fwd.hpp b/include/boost/math/special_functions/math_fwd.hpp index a79718f25..8d580b592 100644 --- a/include/boost/math/special_functions/math_fwd.hpp +++ b/include/boost/math/special_functions/math_fwd.hpp @@ -636,11 +636,11 @@ namespace boost BOOST_MATH_GPU_ENABLED tools::promote_args_t hypot(T1 x, T2 y); - template + template ::is_specialized, bool> = true> BOOST_MATH_GPU_ENABLED tools::promote_args_t hypot(T1 x, T2 y, const Policy&); - template ::value, bool> = true> + template ::is_specialized, bool> = true> BOOST_MATH_GPU_ENABLED tools::promote_args_t hypot(T1 x, T2 y, T3 z);