Chris@16: // (c) Copyright Fernando Luis Cacciola Carballal 2000-2004 Chris@16: // Use, modification, and distribution is subject to the Boost Software Chris@16: // License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at Chris@16: // http://www.boost.org/LICENSE_1_0.txt) Chris@16: Chris@16: // See library home page at http://www.boost.org/libs/numeric/conversion Chris@16: // Chris@16: // Contact the author at: fernando_cacciola@hotmail.com Chris@16: // Chris@16: #ifndef BOOST_NUMERIC_CONVERSION_DETAIL_UDT_BUILTIN_MIXTURE_FLC_12NOV2002_HPP Chris@16: #define BOOST_NUMERIC_CONVERSION_DETAIL_UDT_BUILTIN_MIXTURE_FLC_12NOV2002_HPP Chris@16: Chris@16: #include "boost/type_traits/is_arithmetic.hpp" Chris@16: Chris@16: #include "boost/numeric/conversion/udt_builtin_mixture_enum.hpp" Chris@16: #include "boost/numeric/conversion/detail/meta.hpp" Chris@16: Chris@16: #include "boost/mpl/integral_c.hpp" Chris@16: Chris@16: namespace boost { namespace numeric { namespace convdetail Chris@16: { Chris@16: // Integral Constants for 'UdtMixture' Chris@16: typedef mpl::integral_c builtin2builtin_c ; Chris@16: typedef mpl::integral_c builtin2udt_c ; Chris@16: typedef mpl::integral_c udt2builtin_c ; Chris@16: typedef mpl::integral_c udt2udt_c ; Chris@16: Chris@16: // Metafunction: Chris@16: // Chris@16: // for_udt_mixture::type Chris@16: // Chris@16: // {UdtMixture} is one of the Integral Constants for UdMixture, declared above. Chris@16: // {BuiltIn2BuiltIn,BuiltIn2Udt,Udt2BuiltIn,Udt2Udt} are aribtrary types. (not metafunctions) Chris@16: // Chris@16: // According to the value of 'UdtMixture', selects the corresponding type. Chris@16: // Chris@16: template Chris@16: struct for_udt_builtin_mixture Chris@16: { Chris@16: typedef typename Chris@16: ct_switch4::type Chris@16: type ; Chris@16: } ; Chris@16: Chris@16: // Metafunction: Chris@16: // Chris@16: // get_udt_mixture::type Chris@16: // Chris@16: // Selects the appropriate UdtMixture Integral Constant for the combination T,S. Chris@16: // Chris@16: template Chris@16: struct get_udt_builtin_mixture Chris@16: { Chris@16: typedef is_arithmetic S_builtin ; Chris@16: typedef is_arithmetic T_builtin ; Chris@16: Chris@16: typedef typename Chris@16: for_both::type Chris@16: type ; Chris@16: } ; Chris@16: Chris@16: } } } // namespace boost::numeric::convdetail Chris@16: Chris@16: #endif Chris@16: Chris@16: