The BOOST_PP_ITERATION_DEPTH macro expands to the current file-iteration depth.

Usage

BOOST_PP_ITERATION_DEPTH()

Remarks

If a file-iteration is not in progress, this macro expands to 0.  Otherwise, it expands to the current depth of file-iteration.

See Also

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, 3, "file.h"))
   #include BOOST_PP_ITERATE()

   #endif

#elif BOOST_PP_ITERATION_DEPTH() == 1

   + depth BOOST_PP_ITERATION_DEPTH()
   // ...

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

   #include BOOST_PP_ITERATE()

#elif BOOST_PP_ITERATION_DEPTH() == 2

   - depth BOOST_PP_ITERATION_DEPTH()
   // ...

#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)