/Src/Dependencies/Boost/boost/mpl/aux_/preprocessed/msvc70/modulus.hpp

http://hadesmem.googlecode.com/ · C++ Header · 115 lines · 86 code · 20 blank · 9 comment · 0 complexity · c150c803be81e015b7250b01815dacf0 MD5 · raw file

  1. // Copyright Aleksey Gurtovoy 2000-2004
  2. //
  3. // Distributed under the Boost Software License, Version 1.0.
  4. // (See accompanying file LICENSE_1_0.txt or copy at
  5. // http://www.boost.org/LICENSE_1_0.txt)
  6. //
  7. // Preprocessed version of "boost/mpl/modulus.hpp" header
  8. // -- DO NOT modify by hand!
  9. namespace boost { namespace mpl {
  10. template<
  11. typename Tag1
  12. , typename Tag2
  13. , BOOST_MPL_AUX_NTTP_DECL(int, tag1_) = BOOST_MPL_AUX_MSVC_VALUE_WKND(Tag1)::value
  14. , BOOST_MPL_AUX_NTTP_DECL(int, tag2_) = BOOST_MPL_AUX_MSVC_VALUE_WKND(Tag2)::value
  15. >
  16. struct modulus_impl
  17. : if_c<
  18. ( tag1_ > tag2_ )
  19. , aux::cast2nd_impl< modulus_impl< Tag1,Tag1 >,Tag1, Tag2 >
  20. , aux::cast1st_impl< modulus_impl< Tag2,Tag2 >,Tag1, Tag2 >
  21. >::type
  22. {
  23. };
  24. /// for Digital Mars C++/compilers with no CTPS/TTP support
  25. template<> struct modulus_impl< na,na >
  26. {
  27. template< typename U1, typename U2 > struct apply
  28. {
  29. typedef apply type;
  30. BOOST_STATIC_CONSTANT(int, value = 0);
  31. };
  32. };
  33. template<> struct modulus_impl< na,integral_c_tag >
  34. {
  35. template< typename U1, typename U2 > struct apply
  36. {
  37. typedef apply type;
  38. BOOST_STATIC_CONSTANT(int, value = 0);
  39. };
  40. };
  41. template<> struct modulus_impl< integral_c_tag,na >
  42. {
  43. template< typename U1, typename U2 > struct apply
  44. {
  45. typedef apply type;
  46. BOOST_STATIC_CONSTANT(int, value = 0);
  47. };
  48. };
  49. template< typename T > struct modulus_tag
  50. : tag< T,na >
  51. {
  52. };
  53. template<
  54. typename BOOST_MPL_AUX_NA_PARAM(N1)
  55. , typename BOOST_MPL_AUX_NA_PARAM(N2)
  56. >
  57. struct modulus
  58. : aux::msvc_eti_base< typename apply_wrap2<
  59. modulus_impl<
  60. typename modulus_tag<N1>::type
  61. , typename modulus_tag<N2>::type
  62. >
  63. , N1
  64. , N2
  65. >::type >::type
  66. {
  67. BOOST_MPL_AUX_LAMBDA_SUPPORT(2, modulus, (N1, N2))
  68. };
  69. BOOST_MPL_AUX_NA_SPEC2(2, 2, modulus)
  70. }}
  71. namespace boost { namespace mpl {
  72. namespace aux {
  73. template< typename T, T n1, T n2 >
  74. struct modulus_wknd
  75. {
  76. BOOST_STATIC_CONSTANT(T, value = (n1 % n2));
  77. typedef integral_c< T,value > type;
  78. };
  79. }
  80. template<>
  81. struct modulus_impl< integral_c_tag,integral_c_tag >
  82. {
  83. template< typename N1, typename N2 > struct apply
  84. : aux::modulus_wknd<
  85. typename aux::largest_int<
  86. typename N1::value_type
  87. , typename N2::value_type
  88. >::type
  89. , N1::value
  90. , N2::value
  91. >::type
  92. {
  93. };
  94. };
  95. }}