forked from boostorg/preprocessor
59 lines
1.5 KiB
HTML
59 lines
1.5 KiB
HTML
![]() |
<html>
|
||
|
<head>
|
||
|
<title>BOOST_PP_ITERATION_FLAGS</title>
|
||
|
<link rel="stylesheet" type="text/css" href="../styles.css">
|
||
|
<script language="javascript" type="text/javascript" src="../scripts.js"></script>
|
||
|
</head>
|
||
|
<body onload="init('sample');">
|
||
|
<div style="margin-left: 0px;">
|
||
|
The <b>BOOST_PP_ITERATION_FLAGS</b> macro retrieves flags associated with the current <i>file-iteration</i> depth.
|
||
|
</div>
|
||
|
<h4>Usage</h4>
|
||
|
<div class="code">
|
||
|
<b>BOOST_PP_ITERATION_FLAGS</b>()
|
||
|
</div>
|
||
|
<h4>Remarks</h4>
|
||
|
<div>
|
||
|
This macro is only valid when a <i>file-iteration</i> is in progress.
|
||
|
</div>
|
||
|
<h4>Requirements</h4>
|
||
|
<div>
|
||
|
<b>Header:</b> <a href="../headers/iteration/iterate.hpp.html"><boost/preprocessor/iteration/iterate.hpp></a>
|
||
|
</div>
|
||
|
<h4><a class="local" onclick="toggle('sample');" onmouseover="change(this);" onmouseout="revert(this);">Sample Code</a></h4>
|
||
|
<div id="sample"><pre>
|
||
|
// file.h
|
||
|
#if !BOOST_PP_IS_ITERATING
|
||
|
|
||
|
#ifndef FILE_H_
|
||
|
#define FILE_H_
|
||
|
|
||
|
#include <boost/preprocessor/iteration/iterate.hpp>
|
||
|
|
||
|
// 1st iteration:
|
||
|
#define BOOST_PP_ITERATION_PARAMS_1 (4, (1, 10, "file.h", 0x0001))
|
||
|
#include BOOST_PP_ITERATE()
|
||
|
|
||
|
// 2nd iteration:
|
||
|
#define BOOST_PP_ITERATION_PARAMS_1 (4, (1, 10, "file.h", 0x0002))
|
||
|
#include BOOST_PP_ITERATE()
|
||
|
|
||
|
#endif
|
||
|
|
||
|
#elif BOOST_PP_ITERATION_DEPTH() == 1 /* ... */ \
|
||
|
&& BOOST_PP_ITERATION_FLAGS() == 0x0001 \
|
||
|
/**/
|
||
|
|
||
|
{ 1st }
|
||
|
|
||
|
#elif BOOST_PP_ITERATION_DEPTH() == 1 /* ... */ \
|
||
|
&& BOOST_PP_ITERATION_FLAGS() == 0x0002 \
|
||
|
/**/
|
||
|
|
||
|
{ 2nd }
|
||
|
|
||
|
#endif
|
||
|
<pre></div>
|
||
|
</body>
|
||
|
</html>
|