/////////////////////////////////////////////////////////////////////////////// // Copyright Vicente J. Botet Escriba 2009-2011 // Copyright 2012 John Maddock. Distributed under the Boost // Software License, Version 1.0. (See accompanying file // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) #ifndef BOOST_MP_EXPLICIT_CONVERTIBLE_HPP #define BOOST_MP_EXPLICIT_CONVERTIBLE_HPP #include #include // number_category namespace boost { namespace multiprecision { namespace detail { template struct dummy_size {}; template struct has_generic_interconversion { using type = typename std::conditional< is_number::value && is_number::value, typename std::conditional< number_category::value == number_kind_integer, typename std::conditional< 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, std::integral_constant, std::integral_constant >::type, typename std::conditional< number_category::value == number_kind_rational, typename std::conditional< number_category::value == number_kind_rational || number_category::value == number_kind_rational, std::integral_constant, std::integral_constant >::type, typename std::conditional< number_category::value == number_kind_floating_point, std::integral_constant, std::integral_constant >::type>::type>::type, std::integral_constant >::type; }; template struct is_explicitly_convertible_imp { template static int selector(dummy_size()))>*); template static char selector(...); static constexpr const bool value = sizeof(selector(0)) == sizeof(int); using type = boost::integral_constant; }; template struct is_explicitly_convertible : public is_explicitly_convertible_imp::type { }; }}} // namespace boost::multiprecision::detail #endif