File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed
include/boost/math/policies Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -1003,6 +1003,22 @@ struct is_noexcept_error_policy
1003
1003
&& (t8::value != throw_on_error) && (t8::value != user_error));
1004
1004
};
1005
1005
1006
+ // Generate a forwarding policy to stop further promotion from occurring
1007
+ // For example if a special function for float promotes to double, we don't want the next
1008
+ // function in the call chain to then promote to long double
1009
+ template <typename Policy>
1010
+ using make_forwarding_policy =
1011
+ typename policies::normalise<
1012
+ Policy,
1013
+ policies::promote_float<false >,
1014
+ policies::promote_double<false >,
1015
+ policies::discrete_quantile<>,
1016
+ policies::assert_undefined<>
1017
+ >::type;
1018
+
1019
+ template <typename Policy>
1020
+ using make_forwarding_policy_t = typename make_forwarding_policy<Policy>::type;
1021
+
1006
1022
}}} // namespaces
1007
1023
1008
1024
#endif // BOOST_MATH_POLICY_HPP
You can’t perform that action at this time.
0 commit comments