File indexing completed on 2025-01-18 09:41:17
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012 namespace boost { namespace mpl {
0013
0014 template<
0015 typename Tag1
0016 , typename Tag2
0017
0018 , BOOST_MPL_AUX_NTTP_DECL(int, tag1_) = BOOST_MPL_AUX_MSVC_VALUE_WKND(Tag1)::value
0019 , BOOST_MPL_AUX_NTTP_DECL(int, tag2_) = BOOST_MPL_AUX_MSVC_VALUE_WKND(Tag2)::value
0020 >
0021 struct divides_impl
0022 : if_c<
0023 ( tag1_ > tag2_ )
0024 , aux::cast2nd_impl< divides_impl< Tag1,Tag1 >,Tag1, Tag2 >
0025 , aux::cast1st_impl< divides_impl< Tag2,Tag2 >,Tag1, Tag2 >
0026 >::type
0027 {
0028 };
0029
0030
0031 template<> struct divides_impl< na,na >
0032 {
0033 template< typename U1, typename U2 > struct apply
0034 {
0035 typedef apply type;
0036 BOOST_STATIC_CONSTANT(int, value = 0);
0037 };
0038 };
0039
0040 template<> struct divides_impl< na,integral_c_tag >
0041 {
0042 template< typename U1, typename U2 > struct apply
0043 {
0044 typedef apply type;
0045 BOOST_STATIC_CONSTANT(int, value = 0);
0046 };
0047 };
0048
0049 template<> struct divides_impl< integral_c_tag,na >
0050 {
0051 template< typename U1, typename U2 > struct apply
0052 {
0053 typedef apply type;
0054 BOOST_STATIC_CONSTANT(int, value = 0);
0055 };
0056 };
0057
0058 template< typename T > struct divides_tag
0059 {
0060 typedef typename T::tag type;
0061 };
0062
0063
0064
0065 template<
0066 typename BOOST_MPL_AUX_NA_PARAM(N1)
0067 , typename BOOST_MPL_AUX_NA_PARAM(N2)
0068 >
0069 struct divides2;
0070
0071 template<
0072 typename BOOST_MPL_AUX_NA_PARAM(N1)
0073 , typename BOOST_MPL_AUX_NA_PARAM(N2)
0074 , typename N3 = na, typename N4 = na, typename N5 = na
0075 >
0076 struct divides
0077
0078 : if_<
0079
0080 is_na<N3>
0081 , divides2< N1,N2 >
0082 , divides<
0083 divides2< N1,N2 >
0084 , N3, N4, N5
0085 >
0086 >::type
0087
0088 {
0089 BOOST_MPL_AUX_LAMBDA_SUPPORT(
0090 5
0091 , divides
0092 , ( N1, N2, N3, N4, N5 )
0093 )
0094 };
0095
0096 template<
0097 typename N1
0098 , typename N2
0099 >
0100 struct divides2
0101 : aux::msvc_eti_base< typename apply_wrap2<
0102 divides_impl<
0103 typename divides_tag<N1>::type
0104 , typename divides_tag<N2>::type
0105 >
0106 , N1
0107 , N2
0108 >::type >::type
0109
0110 {
0111 BOOST_MPL_AUX_LAMBDA_SUPPORT(2, divides2, (N1, N2))
0112
0113 };
0114
0115 BOOST_MPL_AUX_NA_SPEC2(2, 5, divides)
0116
0117 }}
0118
0119 namespace boost { namespace mpl {
0120
0121 namespace aux {
0122 template< typename T, T n1, T n2 >
0123 struct divides_wknd
0124 {
0125 BOOST_STATIC_CONSTANT(T, value = (n1 / n2));
0126 typedef integral_c< T,value > type;
0127 };
0128
0129 }
0130
0131 template<>
0132 struct divides_impl< integral_c_tag,integral_c_tag >
0133 {
0134 template< typename N1, typename N2 > struct apply
0135 : aux::divides_wknd<
0136 typename aux::largest_int<
0137 typename N1::value_type
0138 , typename N2::value_type
0139 >::type
0140 , N1::value
0141 , N2::value
0142 >::type
0143
0144 {
0145 };
0146 };
0147
0148 }}