The BOOST_PP_FRAME_ITERATION macro expands to the iteration value of an absolute file-iteration depth.

Usage

BOOST_PP_FRAME_ITERATION(i)

Arguments

i
The absolute depth of the frame whose iteration value is to be retreived.  Valid values range from 1 to BOOST_PP_ITERATION_DEPTH().

Remarks

This macro is only valid when a file-iteration is in progress.

Requirements

Header:  <boost/preprocessor/iteration/iterate.hpp>

Sample Code

// file.h
#if !BOOST_PP_IS_ITERATING

   #ifndef FILE_H_
   #define FILE_H_

   #include <boost/preprocessor/iteration/iterate.hpp>

   #define BOOST_PP_ITERATION_PARAMS_1 (3, (1, 10, "file.h"))
   #include BOOST_PP_ITERATE()

   #endif

#elif BOOST_PP_ITERATION_DEPTH() == 1

   --
   #define BOOST_PP_ITERATION_PARAMS_2 \
      (3, (1, BOOST_PP_ITERATION(), "file.h"))   \
      /**/

   #include BOOST_PP_ITERATE()

#else

   outer: BOOST_PP_FRAME_ITERATION(1)
   inner: BOOST_PP_FRAME_ITERATION(2)

#endif

© Copyright Housemarque Oy 2002
© Copyright Paul Mensonides 2002

Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at www.boost.org/LICENSE_1_0.txt)