Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions include/boost/math/policies/policy.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -493,6 +493,8 @@ class policy<default_policy, default_policy, default_policy, default_policy, def
using max_root_iterations_type = max_root_iterations<>;
};

// When neither float nor double is promoted, policy<> already is the forwarding policy:
#if BOOST_MATH_PROMOTE_FLOAT_POLICY || BOOST_MATH_PROMOTE_DOUBLE_POLICY
template <>
struct policy<detail::forwarding_arg1, detail::forwarding_arg2, default_policy, default_policy, default_policy, default_policy, default_policy, default_policy, default_policy, default_policy, default_policy>
{
Expand All @@ -517,6 +519,7 @@ struct policy<detail::forwarding_arg1, detail::forwarding_arg2, default_policy,
using max_series_iterations_type = max_series_iterations<>;
using max_root_iterations_type = max_root_iterations<>;
};
#endif

BOOST_MATH_EXPORT template <typename Policy,
typename A1 = default_policy,
Expand Down Expand Up @@ -650,6 +653,7 @@ struct normalise<policy<>,
using type = policy<detail::forwarding_arg1, detail::forwarding_arg2>;
};

#if BOOST_MATH_PROMOTE_FLOAT_POLICY || BOOST_MATH_PROMOTE_DOUBLE_POLICY
template <>
struct normalise<policy<detail::forwarding_arg1, detail::forwarding_arg2>,
promote_float<false>,
Expand All @@ -666,6 +670,7 @@ struct normalise<policy<detail::forwarding_arg1, detail::forwarding_arg2>,
{
using type = policy<detail::forwarding_arg1, detail::forwarding_arg2>;
};
#endif

BOOST_MATH_EXPORT BOOST_MATH_GPU_ENABLED constexpr policy<> make_policy() noexcept
{ return {}; }
Expand Down
1 change: 1 addition & 0 deletions test/Jamfile.v2
Original file line number Diff line number Diff line change
Expand Up @@ -1041,6 +1041,7 @@ test-suite misc :
[ run test_policy_7.cpp /boost/test//boost_unit_test_framework ]
[ run test_policy_8.cpp /boost/test//boost_unit_test_framework ]
[ compile test_policy_9.cpp ]
[ compile test_policy_9.cpp : <define>BOOST_MATH_PROMOTE_FLOAT_POLICY=false <define>BOOST_MATH_PROMOTE_DOUBLE_POLICY=false : test_policy_9_no_promotion ]
[ run test_policy_10.cpp /boost/test//boost_unit_test_framework ]
[ run test_policy_sf.cpp /boost/test//boost_unit_test_framework ]
[ run test_long_double_support.cpp /boost/test//boost_unit_test_framework
Expand Down
Loading