advance_forward.hpp 2.1 KB

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