iteration.h 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. # /* **************************************************************************
  2. # * *
  3. # * (C) Copyright Paul Mensonides 2002.
  4. # * Distributed under the Boost Software License, Version 1.0. (See
  5. # * accompanying file LICENSE_1_0.txt or copy at
  6. # * http://www.boost.org/LICENSE_1_0.txt)
  7. # * *
  8. # ************************************************************************** */
  9. #
  10. # /* See http://www.boost.org for most recent version. */
  11. #
  12. # if !BOOST_PP_IS_ITERATING
  13. #
  14. # include <boost/preprocessor/cat.hpp>
  15. # include <boost/preprocessor/iteration.hpp>
  16. # include <libs/preprocessor/test/test.h>
  17. #
  18. # define NO_FLAGS
  19. #
  20. # define BOOST_PP_ITERATION_PARAMS_1 (3, (1, 10, <libs/preprocessor/test/iteration.h>))
  21. # include BOOST_PP_ITERATE()
  22. #
  23. # undef NO_FLAGS
  24. #
  25. # define BOOST_PP_ITERATION_PARAMS_1 (4, (1, 5, <libs/preprocessor/test/iteration.h>, 0x0001))
  26. # include BOOST_PP_ITERATE()
  27. #
  28. # define BOOST_PP_ITERATION_PARAMS_1 (4, (1, 5, <libs/preprocessor/test/iteration.h>, 0x0002))
  29. # include BOOST_PP_ITERATE()
  30. #
  31. # else
  32. # if defined NO_FLAGS
  33. struct BOOST_PP_CAT(X, BOOST_PP_ITERATION()) {
  34. BEGIN
  35. BOOST_PP_ITERATION() >= BOOST_PP_ITERATION_START() &&
  36. BOOST_PP_ITERATION() <= BOOST_PP_ITERATION_FINISH()
  37. END
  38. };
  39. # elif BOOST_PP_ITERATION_DEPTH() == 1 \
  40. && BOOST_PP_ITERATION_FLAGS() == 0x0001
  41. struct BOOST_PP_CAT(Y, BOOST_PP_ITERATION()) { };
  42. # elif BOOST_PP_ITERATION_DEPTH() == 1 \
  43. && BOOST_PP_ITERATION_FLAGS() == 0x0002
  44. # define BOOST_PP_ITERATION_PARAMS_2 (3, (1, BOOST_PP_ITERATION(), <libs/preprocessor/test/iteration.h>))
  45. # include BOOST_PP_ITERATE()
  46. # elif BOOST_PP_ITERATION_DEPTH() == 2 \
  47. && BOOST_PP_FRAME_FLAGS(1) == 0x0002
  48. struct BOOST_PP_CAT(Z, BOOST_PP_CAT(BOOST_PP_ITERATION(), BOOST_PP_RELATIVE_ITERATION(1))) { };
  49. # else
  50. #
  51. # error should not get here!
  52. #
  53. # endif
  54. # endif