bitxor.hpp 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149
  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/bitxor.hpp" header
  9. // -- DO NOT modify by hand!
  10. namespace boost { namespace mpl {
  11. template<
  12. typename Tag1
  13. , typename Tag2
  14. , BOOST_MPL_AUX_NTTP_DECL(int, tag1_) = BOOST_MPL_AUX_MSVC_VALUE_WKND(Tag1)::value
  15. , BOOST_MPL_AUX_NTTP_DECL(int, tag2_) = BOOST_MPL_AUX_MSVC_VALUE_WKND(Tag2)::value
  16. >
  17. struct bitxor_impl
  18. : if_c<
  19. ( tag1_ > tag2_ )
  20. , aux::cast2nd_impl< bitxor_impl< Tag1,Tag1 >,Tag1, Tag2 >
  21. , aux::cast1st_impl< bitxor_impl< Tag2,Tag2 >,Tag1, Tag2 >
  22. >::type
  23. {
  24. };
  25. /// for Digital Mars C++/compilers with no CTPS/TTP support
  26. template<> struct bitxor_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<> struct bitxor_impl< na,integral_c_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<> struct bitxor_impl< integral_c_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 bitxor_tag
  51. {
  52. typedef typename T::tag type;
  53. };
  54. /// forward declaration
  55. template<
  56. typename BOOST_MPL_AUX_NA_PARAM(N1)
  57. , typename BOOST_MPL_AUX_NA_PARAM(N2)
  58. >
  59. struct bitxor_2;
  60. template<
  61. typename BOOST_MPL_AUX_NA_PARAM(N1)
  62. , typename BOOST_MPL_AUX_NA_PARAM(N2)
  63. , typename N3 = na, typename N4 = na, typename N5 = na
  64. >
  65. struct bitxor_
  66. : if_<
  67. is_na<N3>
  68. , bitxor_2< N1,N2 >
  69. , bitxor_<
  70. bitxor_2< N1,N2 >
  71. , N3, N4, N5
  72. >
  73. >::type
  74. {
  75. BOOST_MPL_AUX_LAMBDA_SUPPORT(
  76. 5
  77. , bitxor_
  78. , ( N1, N2, N3, N4, N5 )
  79. )
  80. };
  81. template<
  82. typename N1
  83. , typename N2
  84. >
  85. struct bitxor_2
  86. : aux::msvc_eti_base< typename apply_wrap2<
  87. bitxor_impl<
  88. typename bitxor_tag<N1>::type
  89. , typename bitxor_tag<N2>::type
  90. >
  91. , N1
  92. , N2
  93. >::type >::type
  94. {
  95. BOOST_MPL_AUX_LAMBDA_SUPPORT(2, bitxor_2, (N1, N2))
  96. };
  97. BOOST_MPL_AUX_NA_SPEC2(2, 5, bitxor_)
  98. }}
  99. namespace boost { namespace mpl {
  100. namespace aux {
  101. template< typename T, T n1, T n2 >
  102. struct bitxor_wknd
  103. {
  104. BOOST_STATIC_CONSTANT(T, value = (n1 ^ n2));
  105. typedef integral_c< T,value > type;
  106. };
  107. }
  108. template<>
  109. struct bitxor_impl< integral_c_tag,integral_c_tag >
  110. {
  111. template< typename N1, typename N2 > struct apply
  112. : aux::bitxor_wknd<
  113. typename aux::largest_int<
  114. typename N1::value_type
  115. , typename N2::value_type
  116. >::type
  117. , N1::value
  118. , N2::value
  119. >::type
  120. {
  121. };
  122. };
  123. }}