Home | History | Annotate | Download | only in iteration
      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 # ifndef BOOST_PREPROCESSOR_ITERATION_ITERATE_HPP
     13 # define BOOST_PREPROCESSOR_ITERATION_ITERATE_HPP
     14 #
     15 # include <boost/preprocessor/arithmetic/dec.hpp>
     16 # include <boost/preprocessor/arithmetic/inc.hpp>
     17 # include <boost/preprocessor/array/elem.hpp>
     18 # include <boost/preprocessor/array/size.hpp>
     19 # include <boost/preprocessor/cat.hpp>
     20 # include <boost/preprocessor/slot/slot.hpp>
     21 # include <boost/preprocessor/tuple/elem.hpp>
     22 #
     23 # /* BOOST_PP_ITERATION_DEPTH */
     24 #
     25 # define BOOST_PP_ITERATION_DEPTH() 0
     26 #
     27 # /* BOOST_PP_ITERATION */
     28 #
     29 # define BOOST_PP_ITERATION() BOOST_PP_CAT(BOOST_PP_ITERATION_, BOOST_PP_ITERATION_DEPTH())
     30 #
     31 # /* BOOST_PP_ITERATION_START && BOOST_PP_ITERATION_FINISH */
     32 #
     33 # define BOOST_PP_ITERATION_START() BOOST_PP_CAT(BOOST_PP_ITERATION_START_, BOOST_PP_ITERATION_DEPTH())
     34 # define BOOST_PP_ITERATION_FINISH() BOOST_PP_CAT(BOOST_PP_ITERATION_FINISH_, BOOST_PP_ITERATION_DEPTH())
     35 #
     36 # /* BOOST_PP_ITERATION_FLAGS */
     37 #
     38 # define BOOST_PP_ITERATION_FLAGS() (BOOST_PP_CAT(BOOST_PP_ITERATION_FLAGS_, BOOST_PP_ITERATION_DEPTH())())
     39 #
     40 # /* BOOST_PP_FRAME_ITERATION */
     41 #
     42 # define BOOST_PP_FRAME_ITERATION(i) BOOST_PP_CAT(BOOST_PP_ITERATION_, i)
     43 #
     44 # /* BOOST_PP_FRAME_START && BOOST_PP_FRAME_FINISH */
     45 #
     46 # define BOOST_PP_FRAME_START(i) BOOST_PP_CAT(BOOST_PP_ITERATION_START_, i)
     47 # define BOOST_PP_FRAME_FINISH(i) BOOST_PP_CAT(BOOST_PP_ITERATION_FINISH_, i)
     48 #
     49 # /* BOOST_PP_FRAME_FLAGS */
     50 #
     51 # define BOOST_PP_FRAME_FLAGS(i) (BOOST_PP_CAT(BOOST_PP_ITERATION_FLAGS_, i)())
     52 #
     53 # /* BOOST_PP_RELATIVE_ITERATION */
     54 #
     55 # define BOOST_PP_RELATIVE_ITERATION(i) BOOST_PP_CAT(BOOST_PP_RELATIVE_, i)(BOOST_PP_ITERATION_)
     56 #
     57 # define BOOST_PP_RELATIVE_0(m) BOOST_PP_CAT(m, BOOST_PP_ITERATION_DEPTH())
     58 # define BOOST_PP_RELATIVE_1(m) BOOST_PP_CAT(m, BOOST_PP_DEC(BOOST_PP_ITERATION_DEPTH()))
     59 # define BOOST_PP_RELATIVE_2(m) BOOST_PP_CAT(m, BOOST_PP_DEC(BOOST_PP_DEC(BOOST_PP_ITERATION_DEPTH())))
     60 # define BOOST_PP_RELATIVE_3(m) BOOST_PP_CAT(m, BOOST_PP_DEC(BOOST_PP_DEC(BOOST_PP_DEC(BOOST_PP_ITERATION_DEPTH()))))
     61 # define BOOST_PP_RELATIVE_4(m) BOOST_PP_CAT(m, BOOST_PP_DEC(BOOST_PP_DEC(BOOST_PP_DEC(BOOST_PP_DEC(BOOST_PP_ITERATION_DEPTH())))))
     62 #
     63 # /* BOOST_PP_RELATIVE_START && BOOST_PP_RELATIVE_FINISH */
     64 #
     65 # define BOOST_PP_RELATIVE_START(i) BOOST_PP_CAT(BOOST_PP_RELATIVE_, i)(BOOST_PP_ITERATION_START_)
     66 # define BOOST_PP_RELATIVE_FINISH(i) BOOST_PP_CAT(BOOST_PP_RELATIVE_, i)(BOOST_PP_ITERATION_FINISH_)
     67 #
     68 # /* BOOST_PP_RELATIVE_FLAGS */
     69 #
     70 # define BOOST_PP_RELATIVE_FLAGS(i) (BOOST_PP_CAT(BOOST_PP_RELATIVE_, i)(BOOST_PP_ITERATION_FLAGS_)())
     71 #
     72 # /* BOOST_PP_ITERATE */
     73 #
     74 # define BOOST_PP_ITERATE() BOOST_PP_CAT(BOOST_PP_ITERATE_, BOOST_PP_INC(BOOST_PP_ITERATION_DEPTH()))
     75 #
     76 # define BOOST_PP_ITERATE_1 <boost/preprocessor/iteration/detail/iter/forward1.hpp>
     77 # define BOOST_PP_ITERATE_2 <boost/preprocessor/iteration/detail/iter/forward2.hpp>
     78 # define BOOST_PP_ITERATE_3 <boost/preprocessor/iteration/detail/iter/forward3.hpp>
     79 # define BOOST_PP_ITERATE_4 <boost/preprocessor/iteration/detail/iter/forward4.hpp>
     80 # define BOOST_PP_ITERATE_5 <boost/preprocessor/iteration/detail/iter/forward5.hpp>
     81 #
     82 # endif
     83