blob: f3eb14781149e7b1069406ebd1ce5dafb04992a4 [file] [log] [blame]
Jeff Thompsona28eed82013-08-22 16:21:10 -07001
2// Copyright Aleksey Gurtovoy 2000-2004
3// Copyright Jaap Suter 2003
4//
5// Distributed under the Boost Software License, Version 1.0.
6// (See accompanying file LICENSE_1_0.txt or copy at
7// http://www.boost.org/LICENSE_1_0.txt)
8//
9
10// Preprocessed version of "ndnboost/mpl/bitand.hpp" header
11// -- DO NOT modify by hand!
12
13namespace ndnboost { namespace mpl {
14
15template<
16 typename Tag1
17 , typename Tag2
18
Jeff Thompson3d613fd2013-10-15 15:39:04 -070019 , NDNBOOST_MPL_AUX_NTTP_DECL(int, tag1_) = NDNBOOST_MPL_AUX_MSVC_VALUE_WKND(Tag1)::value
20 , NDNBOOST_MPL_AUX_NTTP_DECL(int, tag2_) = NDNBOOST_MPL_AUX_MSVC_VALUE_WKND(Tag2)::value
Jeff Thompsona28eed82013-08-22 16:21:10 -070021 >
22struct bitand_impl
23 : if_c<
24 ( tag1_ > tag2_ )
25 , aux::cast2nd_impl< bitand_impl< Tag1,Tag1 >,Tag1, Tag2 >
26 , aux::cast1st_impl< bitand_impl< Tag2,Tag2 >,Tag1, Tag2 >
27 >::type
28{
29};
30
31/// for Digital Mars C++/compilers with no CTPS/TTP support
32template<> struct bitand_impl< na,na >
33{
34 template< typename U1, typename U2 > struct apply
35 {
36 typedef apply type;
Jeff Thompson3d613fd2013-10-15 15:39:04 -070037 NDNBOOST_STATIC_CONSTANT(int, value = 0);
Jeff Thompsona28eed82013-08-22 16:21:10 -070038 };
39};
40
41template<> struct bitand_impl< na,integral_c_tag >
42{
43 template< typename U1, typename U2 > struct apply
44 {
45 typedef apply type;
Jeff Thompson3d613fd2013-10-15 15:39:04 -070046 NDNBOOST_STATIC_CONSTANT(int, value = 0);
Jeff Thompsona28eed82013-08-22 16:21:10 -070047 };
48};
49
50template<> struct bitand_impl< integral_c_tag,na >
51{
52 template< typename U1, typename U2 > struct apply
53 {
54 typedef apply type;
Jeff Thompson3d613fd2013-10-15 15:39:04 -070055 NDNBOOST_STATIC_CONSTANT(int, value = 0);
Jeff Thompsona28eed82013-08-22 16:21:10 -070056 };
57};
58
59template< typename T > struct bitand_tag
60{
61 typedef typename T::tag type;
62};
63
64/// forward declaration
65
66template<
Jeff Thompson3d613fd2013-10-15 15:39:04 -070067 typename NDNBOOST_MPL_AUX_NA_PARAM(N1)
68 , typename NDNBOOST_MPL_AUX_NA_PARAM(N2)
Jeff Thompsona28eed82013-08-22 16:21:10 -070069 >
70struct bitand_2;
71
72template<
Jeff Thompson3d613fd2013-10-15 15:39:04 -070073 typename NDNBOOST_MPL_AUX_NA_PARAM(N1)
74 , typename NDNBOOST_MPL_AUX_NA_PARAM(N2)
Jeff Thompsona28eed82013-08-22 16:21:10 -070075 , typename N3 = na, typename N4 = na, typename N5 = na
76 >
77struct bitand_
78
79 : if_<
80
81 is_na<N3>
82 , bitand_2< N1,N2 >
83 , bitand_<
84 bitand_2< N1,N2 >
85 , N3, N4, N5
86 >
87 >::type
88
89{
Jeff Thompson3d613fd2013-10-15 15:39:04 -070090 NDNBOOST_MPL_AUX_LAMBDA_SUPPORT(
Jeff Thompsona28eed82013-08-22 16:21:10 -070091 5
92 , bitand_
93 , ( N1, N2, N3, N4, N5 )
94 )
95};
96
97template<
98 typename N1
99 , typename N2
100 >
101struct bitand_2
102 : aux::msvc_eti_base< typename apply_wrap2<
103 bitand_impl<
104 typename bitand_tag<N1>::type
105 , typename bitand_tag<N2>::type
106 >
107 , N1
108 , N2
109 >::type >::type
110
111{
Jeff Thompson3d613fd2013-10-15 15:39:04 -0700112 NDNBOOST_MPL_AUX_LAMBDA_SUPPORT(2, bitand_2, (N1, N2))
Jeff Thompsona28eed82013-08-22 16:21:10 -0700113
114};
115
Jeff Thompson3d613fd2013-10-15 15:39:04 -0700116NDNBOOST_MPL_AUX_NA_SPEC2(2, 5, bitand_)
Jeff Thompsona28eed82013-08-22 16:21:10 -0700117
118}}
119
120namespace ndnboost { namespace mpl {
121
122namespace aux {
123template< typename T, T n1, T n2 >
124struct bitand_wknd
125{
Jeff Thompson3d613fd2013-10-15 15:39:04 -0700126 NDNBOOST_STATIC_CONSTANT(T, value = (n1 & n2));
Jeff Thompsona28eed82013-08-22 16:21:10 -0700127 typedef integral_c< T,value > type;
128};
129
130}
131
132template<>
133struct bitand_impl< integral_c_tag,integral_c_tag >
134{
135 template< typename N1, typename N2 > struct apply
136 : aux::bitand_wknd<
137 typename aux::largest_int<
138 typename N1::value_type
139 , typename N2::value_type
140 >::type
141 , N1::value
142 , N2::value
143 >::type
144
145 {
146 };
147};
148
149}}