File indexing completed on 2025-01-18 09:42:46
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010 #ifndef BOOST_NUMERIC_CONVERSION_DETAIL_META_FLC_12NOV2002_HPP
0011 #define BOOST_NUMERIC_CONVERSION_DETAIL_META_FLC_12NOV2002_HPP
0012
0013 #include "boost/type_traits/remove_cv.hpp"
0014
0015 #include "boost/mpl/if.hpp"
0016 #include "boost/mpl/eval_if.hpp"
0017 #include "boost/mpl/equal_to.hpp"
0018 #include "boost/mpl/not.hpp"
0019 #include "boost/mpl/and.hpp"
0020 #include "boost/mpl/bool.hpp"
0021 #include "boost/mpl/identity.hpp"
0022
0023 namespace boost { namespace numeric { namespace convdetail
0024 {
0025 template< class T1, class T2>
0026 struct equal_to
0027 {
0028 #if !defined(BOOST_BORLANDC)
0029
0030 enum { x = ( BOOST_MPL_AUX_VALUE_WKND(T1)::value == BOOST_MPL_AUX_VALUE_WKND(T2)::value ) };
0031
0032 BOOST_STATIC_CONSTANT(bool, value = x);
0033
0034 typedef mpl::bool_<value> type;
0035
0036 #else
0037
0038 BOOST_STATIC_CONSTANT(bool, value = (
0039 BOOST_MPL_AUX_VALUE_WKND(T1)::value
0040 == BOOST_MPL_AUX_VALUE_WKND(T2)::value
0041 ));
0042
0043 typedef mpl::bool_<(
0044 BOOST_MPL_AUX_VALUE_WKND(T1)::value
0045 == BOOST_MPL_AUX_VALUE_WKND(T2)::value
0046 )> type;
0047 #endif
0048 };
0049
0050
0051
0052
0053
0054
0055
0056
0057
0058
0059 template<class Value,
0060 class Case0Val,
0061 class Case1Val,
0062 class Case2Val,
0063 class Case0Type,
0064 class Case1Type,
0065 class Case2Type,
0066 class DefaultType
0067 >
0068 struct ct_switch4
0069 {
0070 typedef mpl::identity<Case0Type> Case0TypeQ ;
0071 typedef mpl::identity<Case1Type> Case1TypeQ ;
0072
0073 typedef equal_to<Value,Case0Val> is_case0 ;
0074 typedef equal_to<Value,Case1Val> is_case1 ;
0075 typedef equal_to<Value,Case2Val> is_case2 ;
0076
0077 typedef mpl::if_<is_case2,Case2Type,DefaultType> choose_2_3Q ;
0078 typedef mpl::eval_if<is_case1,Case1TypeQ,choose_2_3Q> choose_1_2_3Q ;
0079
0080 typedef typename
0081 mpl::eval_if<is_case0,Case0TypeQ,choose_1_2_3Q>::type
0082 type ;
0083 } ;
0084
0085
0086
0087
0088
0089
0090
0091
0092
0093
0094
0095
0096
0097 template<class expr0, class expr1, class TT, class TF, class FT, class FF>
0098 struct for_both
0099 {
0100 typedef mpl::identity<TF> TF_Q ;
0101 typedef mpl::identity<TT> TT_Q ;
0102
0103 typedef typename mpl::not_<expr0>::type not_expr0 ;
0104 typedef typename mpl::not_<expr1>::type not_expr1 ;
0105
0106 typedef typename mpl::and_<expr0,expr1>::type caseTT ;
0107 typedef typename mpl::and_<expr0,not_expr1>::type caseTF ;
0108 typedef typename mpl::and_<not_expr0,expr1>::type caseFT ;
0109
0110 typedef mpl::if_<caseFT,FT,FF> choose_FT_FF_Q ;
0111 typedef mpl::eval_if<caseTF,TF_Q,choose_FT_FF_Q> choose_TF_FT_FF_Q ;
0112
0113 typedef typename mpl::eval_if<caseTT,TT_Q,choose_TF_FT_FF_Q>::type type ;
0114 } ;
0115
0116 } } }
0117
0118 #endif
0119
0120