shift_right.hpp 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  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. }}