williamr@2: // © Copyright Fernando Luis Cacciola Carballal 2000-2004 williamr@2: // Use, modification, and distribution is subject to the Boost Software williamr@2: // License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at williamr@2: // http://www.boost.org/LICENSE_1_0.txt) williamr@2: williamr@2: // See library home page at http://www.boost.org/libs/numeric/conversion williamr@2: // williamr@2: // Contact the author at: fernando_cacciola@hotmail.com williamr@2: // williamr@2: #ifndef BOOST_NUMERIC_CONVERSION_DETAIL_INT_FLOAT_MIXTURE_FLC_12NOV2002_HPP williamr@2: #define BOOST_NUMERIC_CONVERSION_DETAIL_INT_FLOAT_MIXTURE_FLC_12NOV2002_HPP williamr@2: williamr@2: #include "boost/config.hpp" williamr@2: #include "boost/limits.hpp" williamr@2: williamr@2: #include "boost/numeric/conversion/int_float_mixture_enum.hpp" williamr@2: #include "boost/numeric/conversion/detail/meta.hpp" williamr@2: williamr@2: #include "boost/mpl/integral_c.hpp" williamr@2: williamr@2: namespace boost { namespace numeric { namespace convdetail williamr@2: { williamr@2: // Integral Constants for 'IntFloatMixture' williamr@2: typedef mpl::integral_c int2int_c ; williamr@2: typedef mpl::integral_c int2float_c ; williamr@2: typedef mpl::integral_c float2int_c ; williamr@2: typedef mpl::integral_c float2float_c ; williamr@2: williamr@2: // Metafunction: williamr@2: // williamr@2: // get_int_float_mixture::type williamr@2: // williamr@2: // Selects the appropriate Int-Float Mixture Integral Constant for the combination T,S. williamr@2: // williamr@2: template williamr@2: struct get_int_float_mixture williamr@2: { williamr@2: typedef mpl::bool_< ::std::numeric_limits::is_integer > S_int ; williamr@2: typedef mpl::bool_< ::std::numeric_limits::is_integer > T_int ; williamr@2: williamr@2: typedef typename williamr@2: for_both::type williamr@2: type ; williamr@2: } ; williamr@2: williamr@2: // Metafunction: williamr@2: // williamr@2: // for_int_float_mixture::type williamr@2: // williamr@2: // {Mixture} is one of the Integral Constants for Mixture, declared above. williamr@2: // {int_int,int_float,float_int,float_float} are aribtrary types. (not metafunctions) williamr@2: // williamr@2: // According to the value of 'IntFloatMixture', selects the corresponding type. williamr@2: // williamr@2: template williamr@2: struct for_int_float_mixture williamr@2: { williamr@2: typedef typename williamr@2: ct_switch4::type williamr@2: type ; williamr@2: } ; williamr@2: williamr@2: } } } // namespace boost::numeric::convdetail williamr@2: williamr@2: #endif williamr@2: // williamr@2: /////////////////////////////////////////////////////////////////////////////////////////////// williamr@2: williamr@2: