File indexing completed on 2025-01-18 09:41:35
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 struct plus_impl
0019 : if_c<
0020 ( BOOST_MPL_AUX_NESTED_VALUE_WKND(int, Tag1)
0021 > BOOST_MPL_AUX_NESTED_VALUE_WKND(int, Tag2)
0022 )
0023
0024 , aux::cast2nd_impl< plus_impl< Tag1,Tag1 >,Tag1, Tag2 >
0025 , aux::cast1st_impl< plus_impl< Tag2,Tag2 >,Tag1, Tag2 >
0026 >::type
0027 {
0028 };
0029
0030
0031 template<> struct plus_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< typename Tag > struct plus_impl< na,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< typename Tag > struct plus_impl< 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 plus_tag
0059 {
0060 typedef typename T::tag type;
0061 };
0062
0063 template<
0064 typename BOOST_MPL_AUX_NA_PARAM(N1)
0065 , typename BOOST_MPL_AUX_NA_PARAM(N2)
0066 , typename N3 = na, typename N4 = na, typename N5 = na
0067 >
0068 struct plus
0069 : plus< plus< plus< plus< N1,N2 >, N3>, N4>, N5>
0070 {
0071 };
0072
0073 template<
0074 typename N1, typename N2, typename N3, typename N4
0075 >
0076 struct plus< N1,N2,N3,N4,na >
0077
0078 : plus< plus< plus< N1,N2 >, N3>, N4>
0079 {
0080 BOOST_MPL_AUX_LAMBDA_SUPPORT_SPEC(
0081 5
0082 , plus
0083 , ( N1, N2, N3, N4, na )
0084 )
0085 };
0086
0087 template<
0088 typename N1, typename N2, typename N3
0089 >
0090 struct plus< N1,N2,N3,na,na >
0091
0092 : plus< plus< N1,N2 >, N3>
0093 {
0094 BOOST_MPL_AUX_LAMBDA_SUPPORT_SPEC(
0095 5
0096 , plus
0097 , ( N1, N2, N3, na, na )
0098 )
0099 };
0100
0101 template<
0102 typename N1, typename N2
0103 >
0104 struct plus< N1,N2,na,na,na >
0105 : plus_impl<
0106 typename plus_tag<N1>::type
0107 , typename plus_tag<N2>::type
0108 >::template apply< N1,N2 >::type
0109 {
0110 BOOST_MPL_AUX_LAMBDA_SUPPORT_SPEC(
0111 5
0112 , plus
0113 , ( N1, N2, na, na, na )
0114 )
0115
0116 };
0117
0118 BOOST_MPL_AUX_NA_SPEC2(2, 5, plus)
0119
0120 }}
0121
0122 namespace boost { namespace mpl {
0123 template<>
0124 struct plus_impl< integral_c_tag,integral_c_tag >
0125 {
0126 template< typename N1, typename N2 > struct apply
0127
0128 : integral_c<
0129 typename aux::largest_int<
0130 typename N1::value_type
0131 , typename N2::value_type
0132 >::type
0133 , ( BOOST_MPL_AUX_VALUE_WKND(N1)::value
0134 + BOOST_MPL_AUX_VALUE_WKND(N2)::value
0135 )
0136 >
0137 {
0138 };
0139 };
0140
0141 }}