Brian Silverman | f27e085 | 2018-08-04 23:56:45 -0700 | [diff] [blame^] | 1 | <html> |
| 2 | <head> |
| 3 | <title>BOOST_PP_ITERATION_DEPTH</title> |
| 4 | <link rel="stylesheet" type="text/css" href="../styles.css"> |
| 5 | </head> |
| 6 | <body> |
| 7 | <div style="margin-left: 0px;"> |
| 8 | The <b>BOOST_PP_ITERATION_DEPTH</b> macro expands to the current <i>file-iteration</i> depth. |
| 9 | </div> |
| 10 | <h4>Usage</h4> |
| 11 | <div class="code"> |
| 12 | <b>BOOST_PP_ITERATION_DEPTH</b>() |
| 13 | </div> |
| 14 | <h4>Remarks</h4> |
| 15 | <div> |
| 16 | If a <i>file-iteration</i> is not in progress, this macro expands to <i>0</i>. |
| 17 | Otherwise, it expands to the current depth of <i>file-iteration</i>. |
| 18 | </div> |
| 19 | <h4>See Also</h4> |
| 20 | <ul> |
| 21 | <li><a href="frame_iteration.html">BOOST_PP_FRAME_ITERATION</a></li> |
| 22 | <li><a href="relative_iteration.html">BOOST_PP_RELATIVE_ITERATION</a></li> |
| 23 | </ul> |
| 24 | <h4>Requirements</h4> |
| 25 | <div> |
| 26 | <b>Header:</b> <a href="../headers/iteration/iterate.html"><boost/preprocessor/iteration/iterate.hpp></a> |
| 27 | </div> |
| 28 | <h4>Sample Code</h4> |
| 29 | <div><pre> |
| 30 | // file.h |
| 31 | #if !<a href="is_iterating.html">BOOST_PP_IS_ITERATING</a> |
| 32 | |
| 33 | #ifndef FILE_H_ |
| 34 | #define FILE_H_ |
| 35 | |
| 36 | #include <<a href="../headers/iteration/iterate.html">boost/preprocessor/iteration/iterate.hpp</a>> |
| 37 | |
| 38 | #define <a href="iteration_params_x.html">BOOST_PP_ITERATION_PARAMS_1</a> (3, (1, 3, "file.h")) |
| 39 | #include <a href="iterate.html">BOOST_PP_ITERATE</a>() |
| 40 | |
| 41 | #endif |
| 42 | |
| 43 | #elif <a href="iteration_depth.html">BOOST_PP_ITERATION_DEPTH</a>() == 1 |
| 44 | |
| 45 | + depth <a href="iteration_depth.html">BOOST_PP_ITERATION_DEPTH</a>() |
| 46 | // ... |
| 47 | |
| 48 | #define <a href="iteration_params_x.html">BOOST_PP_ITERATION_PARAMS_2</a> \ |
| 49 | (3, (1, <a href="iteration.html">BOOST_PP_ITERATION</a>(), "file.h")) \ |
| 50 | /**/ |
| 51 | |
| 52 | #include <a href="iterate.html">BOOST_PP_ITERATE</a>() |
| 53 | |
| 54 | #elif <a href="iteration_depth.html">BOOST_PP_ITERATION_DEPTH</a>() == 2 |
| 55 | |
| 56 | - depth <a href="iteration_depth.html">BOOST_PP_ITERATION_DEPTH</a>() |
| 57 | // ... |
| 58 | |
| 59 | #endif |
| 60 | </pre></div> |
| 61 | <hr size="1"> |
| 62 | <div style="margin-left: 0px;"> |
| 63 | <i>© Copyright <a href="http://www.housemarque.com" target="_top">Housemarque Oy</a> 2002</i> |
| 64 | </br><i>© Copyright Paul Mensonides 2002</i> |
| 65 | </div> |
| 66 | <div style="margin-left: 0px;"> |
| 67 | <p><small>Distributed under the Boost Software License, Version 1.0. (See |
| 68 | accompanying file <a href="../../../../LICENSE_1_0.txt">LICENSE_1_0.txt</a> or |
| 69 | copy at <a href= |
| 70 | "http://www.boost.org/LICENSE_1_0.txt">www.boost.org/LICENSE_1_0.txt</a>)</small></p> |
| 71 | </div> |
| 72 | </body> |
| 73 | </html> |