File indexing completed on 2025-01-18 09:42:47
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010 #ifndef BOOST_NUMERIC_CONVERSION_DETAIL_SIGN_MIXTURE_FLC_12NOV2002_HPP
0011 #define BOOST_NUMERIC_CONVERSION_DETAIL_SIGN_MIXTURE_FLC_12NOV2002_HPP
0012
0013 #include "boost/config.hpp"
0014 #include "boost/limits.hpp"
0015
0016 #include "boost/numeric/conversion/sign_mixture_enum.hpp"
0017 #include "boost/numeric/conversion/detail/meta.hpp"
0018
0019 #include "boost/type_traits/integral_constant.hpp"
0020
0021 namespace boost { namespace numeric { namespace convdetail
0022 {
0023
0024 typedef boost::integral_constant<sign_mixture_enum, unsigned_to_unsigned> unsig2unsig_c ;
0025 typedef boost::integral_constant<sign_mixture_enum, signed_to_signed> sig2sig_c ;
0026 typedef boost::integral_constant<sign_mixture_enum, signed_to_unsigned> sig2unsig_c ;
0027 typedef boost::integral_constant<sign_mixture_enum, unsigned_to_signed> unsig2sig_c ;
0028
0029
0030
0031
0032
0033
0034
0035 template<class T,class S>
0036 struct get_sign_mixture
0037 {
0038 typedef mpl::bool_< ::std::numeric_limits<S>::is_signed > S_signed ;
0039 typedef mpl::bool_< ::std::numeric_limits<T>::is_signed > T_signed ;
0040
0041 typedef typename
0042 for_both<S_signed, T_signed, sig2sig_c, sig2unsig_c, unsig2sig_c, unsig2unsig_c>::type
0043 type ;
0044 } ;
0045
0046
0047
0048
0049
0050
0051
0052
0053
0054
0055 template<class SignMixture, class Sig2Sig, class Sig2Unsig, class Unsig2Sig, class Unsig2Unsig>
0056 struct for_sign_mixture
0057 {
0058 typedef typename
0059 ct_switch4<SignMixture
0060 , sig2sig_c, sig2unsig_c, unsig2sig_c
0061 , Sig2Sig , Sig2Unsig , Unsig2Sig , Unsig2Unsig
0062 >::type
0063 type ;
0064 } ;
0065
0066 } } }
0067
0068 #endif
0069
0070
0071
0072