advance_backward.hpp 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  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/aux_/advance_backward.hpp" header
  8. // -- DO NOT modify by hand!
  9. namespace boost { namespace mpl { namespace aux {
  10. template< long N > struct advance_backward;
  11. template<>
  12. struct advance_backward<0>
  13. {
  14. template< typename Iterator > struct apply
  15. {
  16. typedef Iterator iter0;
  17. typedef iter0 type;
  18. };
  19. };
  20. template<>
  21. struct advance_backward<1>
  22. {
  23. template< typename Iterator > struct apply
  24. {
  25. typedef Iterator iter0;
  26. typedef typename prior<iter0>::type iter1;
  27. typedef iter1 type;
  28. };
  29. };
  30. template<>
  31. struct advance_backward<2>
  32. {
  33. template< typename Iterator > struct apply
  34. {
  35. typedef Iterator iter0;
  36. typedef typename prior<iter0>::type iter1;
  37. typedef typename prior<iter1>::type iter2;
  38. typedef iter2 type;
  39. };
  40. };
  41. template<>
  42. struct advance_backward<3>
  43. {
  44. template< typename Iterator > struct apply
  45. {
  46. typedef Iterator iter0;
  47. typedef typename prior<iter0>::type iter1;
  48. typedef typename prior<iter1>::type iter2;
  49. typedef typename prior<iter2>::type iter3;
  50. typedef iter3 type;
  51. };
  52. };
  53. template<>
  54. struct advance_backward<4>
  55. {
  56. template< typename Iterator > struct apply
  57. {
  58. typedef Iterator iter0;
  59. typedef typename prior<iter0>::type iter1;
  60. typedef typename prior<iter1>::type iter2;
  61. typedef typename prior<iter2>::type iter3;
  62. typedef typename prior<iter3>::type iter4;
  63. typedef iter4 type;
  64. };
  65. };
  66. template< long N >
  67. struct advance_backward
  68. {
  69. template< typename Iterator > struct apply
  70. {
  71. typedef typename apply_wrap1<
  72. advance_backward<4>
  73. , Iterator
  74. >::type chunk_result_;
  75. typedef typename apply_wrap1<
  76. advance_backward<(
  77. (N - 4) < 0
  78. ? 0
  79. : N - 4
  80. )>
  81. , chunk_result_
  82. >::type type;
  83. };
  84. };
  85. }}}