shift_right.hpp 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  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/shift_right.hpp" header
  9. // -- DO NOT modify by hand!
  10. namespace boost { namespace mpl {
  11. template<
  12. typename Tag1
  13. , typename Tag2
  14. >
  15. struct shift_right_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< shift_right_impl< Tag1,Tag1 >,Tag1, Tag2 >
  21. , aux::cast1st_impl< shift_right_impl< Tag2,Tag2 >,Tag1, Tag2 >
  22. >::type
  23. {
  24. };
  25. /// for Digital Mars C++/compilers with no CTPS/TTP support
  26. template<> struct shift_right_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 shift_right_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 shift_right_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 shift_right_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. >
  58. struct shift_right
  59. : shift_right_impl<
  60. typename shift_right_tag<N1>::type
  61. , typename shift_right_tag<N2>::type
  62. >::template apply< N1,N2 >::type
  63. {
  64. };
  65. BOOST_MPL_AUX_NA_SPEC2(2, 2, shift_right)
  66. }}
  67. namespace boost { namespace mpl {
  68. template<>
  69. struct shift_right_impl< integral_c_tag,integral_c_tag >
  70. {
  71. template< typename N, typename S > struct apply
  72. : integral_c<
  73. typename N::value_type
  74. , ( BOOST_MPL_AUX_VALUE_WKND(N)::value
  75. >> BOOST_MPL_AUX_VALUE_WKND(S)::value
  76. )
  77. >
  78. {
  79. };
  80. };
  81. }}