X-Git-Url: https://git.donarmstrong.com/?p=rsem.git;a=blobdiff_plain;f=boost%2Fmath%2Ftools%2Fpromotion.hpp;fp=boost%2Fmath%2Ftools%2Fpromotion.hpp;h=b3ad2040779e36e4b79e983abc2615647b598ba4;hp=83772f52e2a8c6a3c487984de4b06522089ce801;hb=2d71eb92104693ca9baa5a2e1c23eeca776d8fd3;hpb=da57529b92adbb7ae74a89861cb39fb35ac7c62d diff --git a/boost/math/tools/promotion.hpp b/boost/math/tools/promotion.hpp index 83772f5..b3ad204 100644 --- a/boost/math/tools/promotion.hpp +++ b/boost/math/tools/promotion.hpp @@ -33,6 +33,7 @@ #include // for boost::mpl::if_c. #include // for boost::mpl::if_c. #include // for boost::mpl::if_c. +#include // for boost::mpl::if_c. #ifdef BOOST_MATH_NO_LONG_DOUBLE_MATH_FUNCTIONS #include @@ -93,7 +94,7 @@ namespace boost >::type >::type, // else one or the other is a user-defined type: - typename mpl::if_< ::boost::is_convertible, T2P, T1P>::type>::type type; + typename mpl::if_< typename mpl::and_ >, ::boost::is_convertible >, T2P, T1P>::type>::type type; }; // promote_arg2 // These full specialisations reduce mpl::if_ usage and speed up // compilation: @@ -137,10 +138,35 @@ namespace boost // // Guard against use of long double if it's not supported: // - BOOST_STATIC_ASSERT((0 == ::boost::is_same::value)); + BOOST_STATIC_ASSERT_MSG((0 == ::boost::is_same::value), "Sorry, but this platform does not have sufficient long double support for the special functions to be reliably implemented."); #endif }; + // + // This struct is the same as above, but has no static assert on long double usage, + // it should be used only on functions that can be implemented for long double + // even when std lib support is missing or broken for that type. + // + template + struct promote_args_permissive + { + typedef typename promote_args_2< + typename remove_cv::type, + typename promote_args_2< + typename remove_cv::type, + typename promote_args_2< + typename remove_cv::type, + typename promote_args_2< + typename remove_cv::type, + typename promote_args_2< + typename remove_cv::type, typename remove_cv::type + >::type + >::type + >::type + >::type + >::type type; + }; + } // namespace tools } // namespace math } // namespace boost