diff --git a/include/boost/multiprecision/traits/explicit_conversion.hpp b/include/boost/multiprecision/traits/explicit_conversion.hpp index b4cd8215..0a14f034 100644 --- a/include/boost/multiprecision/traits/explicit_conversion.hpp +++ b/include/boost/multiprecision/traits/explicit_conversion.hpp @@ -11,69 +11,79 @@ #include -namespace boost{ namespace multiprecision{ namespace detail{ +namespace boost { + namespace multiprecision { + namespace detail { -template -struct dummy_size{}; + template + struct dummy_size {}; -template -struct has_generic_interconversion -{ - typedef typename mpl::if_c< - is_number::value && is_number::value, - typename mpl::if_c< - number_category::value == number_kind_integer, - typename mpl::if_c< - number_category::value == number_kind_integer - || number_category::value == number_kind_floating_point - || number_category::value == number_kind_rational - || number_category::value == number_kind_fixed_point, - mpl::true_, - mpl::false_ - >::type, - typename mpl::if_c< - number_category::value == number_kind_rational, - typename mpl::if_c< + template + struct has_generic_interconversion + { + typedef typename mpl::if_c < + is_number::value && is_number::value, + typename mpl::if_c < + number_category::value == number_kind_integer, + typename mpl::if_c< + number_category::value == number_kind_integer + || number_category::value == number_kind_floating_point + || number_category::value == number_kind_rational + || number_category::value == number_kind_fixed_point, + mpl::true_, + mpl::false_ + >::type, + typename mpl::if_c< + number_category::value == number_kind_rational, + typename mpl::if_c< number_category::value == number_kind_rational || number_category::value == number_kind_rational, mpl::true_, mpl::false_ - >::type, - typename mpl::if_c< + >::type, + typename mpl::if_c< number_category::value == number_kind_floating_point, mpl::true_, mpl::false_ - >::type - >::type - >::type, - mpl::false_ - >::type type; -}; + >::type + >::type + > ::type, + mpl::false_ + > ::type type; + }; -template -struct is_explicitly_convertible_imp -{ + template + struct is_explicitly_convertible_imp + { #ifndef BOOST_NO_SFINAE_EXPR - template - static type_traits::yes_type selector(dummy_size(declval()))>*); + template + static type_traits::yes_type selector(dummy_size(declval()))>*); - template - static type_traits::no_type selector(...); + template + static type_traits::no_type selector(...); - static const bool value = sizeof(selector(0)) == sizeof(type_traits::yes_type); + static const bool value = sizeof(selector(0)) == sizeof(type_traits::yes_type); - typedef boost::integral_constant type; + typedef boost::integral_constant type; #else - typedef typename has_generic_interconversion::type gen_type; - typedef mpl::bool_::value || gen_type::value> type; + typedef typename has_generic_interconversion::type gen_type; + typedef mpl::bool_::value || gen_type::value> type; #endif -}; + }; template struct is_explicitly_convertible : public is_explicitly_convertible_imp::type { }; +#ifdef BOOST_NO_SFINAE_EXPR +template +struct is_explicitly_convertible, number > + : public is_explicitly_convertible +{ +}; +#endif + }}} // namespaces #endif