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_SIGN_MIXTURE_FLC_12NOV2002_HPP Chris@16: #define BOOST_NUMERIC_CONVERSION_DETAIL_SIGN_MIXTURE_FLC_12NOV2002_HPP Chris@16: Chris@16: #include "boost/config.hpp" Chris@16: #include "boost/limits.hpp" Chris@16: Chris@16: #include "boost/numeric/conversion/sign_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 'SignMixture' Chris@16: typedef mpl::integral_c unsig2unsig_c ; Chris@16: typedef mpl::integral_c sig2sig_c ; Chris@16: typedef mpl::integral_c sig2unsig_c ; Chris@16: typedef mpl::integral_c unsig2sig_c ; Chris@16: Chris@16: // Metafunction: Chris@16: // Chris@16: // get_sign_mixture::type Chris@16: // Chris@16: // Selects the appropriate SignMixture Integral Constant for the combination T,S. Chris@16: // Chris@16: template Chris@16: struct get_sign_mixture Chris@16: { Chris@16: typedef mpl::bool_< ::std::numeric_limits::is_signed > S_signed ; Chris@16: typedef mpl::bool_< ::std::numeric_limits::is_signed > T_signed ; Chris@16: Chris@16: typedef typename Chris@16: for_both::type Chris@16: type ; Chris@16: } ; Chris@16: Chris@16: // Metafunction: Chris@16: // Chris@16: // for_sign_mixture::type Chris@16: // Chris@16: // {SignMixture} is one of the Integral Constants for SignMixture, declared above. Chris@16: // {Sig2Sig,Sig2Unsig,Unsig2Sig,Unsig2Unsig} are aribtrary types. (not metafunctions) Chris@16: // Chris@16: // According to the value of 'SignMixture', selects the corresponding type. Chris@16: // Chris@16: template Chris@16: struct for_sign_mixture Chris@16: { Chris@16: typedef typename Chris@16: ct_switch4::type Chris@16: type ; Chris@16: } ; Chris@16: Chris@16: } } } // namespace boost::numeric::convdetail Chris@16: Chris@16: #endif Chris@16: // Chris@16: /////////////////////////////////////////////////////////////////////////////////////////////// Chris@16: Chris@16: