bitand.hpp 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  1. // Copyright Aleksey Gurtovoy 2000-2004
  2. // Copyright Jaap Suter 2003
  3. //
  4. // Distributed under the Boost Software License, Version 1.0.
  5. // (See accompanying file LICENSE_1_0.txt or copy at
  6. // http://www.boost.org/LICENSE_1_0.txt)
  7. //
  8. // Preprocessed version of "boost/mpl/bitand.hpp" header
  9. // -- DO NOT modify by hand!
  10. namespace boost { namespace mpl {
  11. template<
  12. typename Tag1
  13. , typename Tag2
  14. >
  15. struct bitand_impl
  16. : if_c<
  17. ( BOOST_MPL_AUX_NESTED_VALUE_WKND(int, Tag1)
  18. > BOOST_MPL_AUX_NESTED_VALUE_WKND(int, Tag2)
  19. )
  20. , aux::cast2nd_impl< bitand_impl< Tag1,Tag1 >,Tag1, Tag2 >
  21. , aux::cast1st_impl< bitand_impl< Tag2,Tag2 >,Tag1, Tag2 >
  22. >::type
  23. {
  24. };
  25. /// for Digital Mars C++/compilers with no CTPS/TTP support
  26. template<> struct bitand_impl< na,na >
  27. {
  28. template< typename U1, typename U2 > struct apply
  29. {
  30. typedef apply type;
  31. BOOST_STATIC_CONSTANT(int, value = 0);
  32. };
  33. };
  34. template< typename Tag > struct bitand_impl< na,Tag >
  35. {
  36. template< typename U1, typename U2 > struct apply
  37. {
  38. typedef apply type;
  39. BOOST_STATIC_CONSTANT(int, value = 0);
  40. };
  41. };
  42. template< typename Tag > struct bitand_impl< Tag,na >
  43. {
  44. template< typename U1, typename U2 > struct apply
  45. {
  46. typedef apply type;
  47. BOOST_STATIC_CONSTANT(int, value = 0);
  48. };
  49. };
  50. template< typename T > struct bitand_tag
  51. {
  52. typedef typename T::tag type;
  53. };
  54. template<
  55. typename BOOST_MPL_AUX_NA_PARAM(N1)
  56. , typename BOOST_MPL_AUX_NA_PARAM(N2)
  57. , typename N3 = na, typename N4 = na, typename N5 = na
  58. >
  59. struct bitand_
  60. : bitand_< bitand_< bitand_< bitand_< N1,N2 >, N3>, N4>, N5>
  61. {
  62. };
  63. template<
  64. typename N1, typename N2, typename N3, typename N4
  65. >
  66. struct bitand_< N1,N2,N3,N4,na >
  67. : bitand_< bitand_< bitand_< N1,N2 >, N3>, N4>
  68. {
  69. BOOST_MPL_AUX_LAMBDA_SUPPORT_SPEC(
  70. 5
  71. , bitand_
  72. , ( N1, N2, N3, N4, na )
  73. )
  74. };
  75. template<
  76. typename N1, typename N2, typename N3
  77. >
  78. struct bitand_< N1,N2,N3,na,na >
  79. : bitand_< bitand_< N1,N2 >, N3>
  80. {
  81. BOOST_MPL_AUX_LAMBDA_SUPPORT_SPEC(
  82. 5
  83. , bitand_
  84. , ( N1, N2, N3, na, na )
  85. )
  86. };
  87. template<
  88. typename N1, typename N2
  89. >
  90. struct bitand_< N1,N2,na,na,na >
  91. : bitand_impl<
  92. typename bitand_tag<N1>::type
  93. , typename bitand_tag<N2>::type
  94. >::template apply< N1,N2 >::type
  95. {
  96. BOOST_MPL_AUX_LAMBDA_SUPPORT_SPEC(
  97. 5
  98. , bitand_
  99. , ( N1, N2, na, na, na )
  100. )
  101. };
  102. BOOST_MPL_AUX_NA_SPEC2(2, 5, bitand_)
  103. }}
  104. namespace boost { namespace mpl {
  105. template<>
  106. struct bitand_impl< integral_c_tag,integral_c_tag >
  107. {
  108. template< typename N1, typename N2 > struct apply
  109. : integral_c<
  110. typename aux::largest_int<
  111. typename N1::value_type
  112. , typename N2::value_type
  113. >::type
  114. , ( BOOST_MPL_AUX_VALUE_WKND(N1)::value
  115. & BOOST_MPL_AUX_VALUE_WKND(N2)::value
  116. )
  117. >
  118. {
  119. };
  120. };
  121. }}