mirror of
https://github.com/boostorg/preprocessor.git
synced 2025-07-12 12:06:34 +02:00
Longer macro parameter names
[SVN r13459]
This commit is contained in:
@ -26,9 +26,11 @@
|
||||
|
||||
<hr>
|
||||
|
||||
<h2><a name="BOOST_PP_ASSERT_MSG">#define BOOST_PP_ASSERT_MSG</a>(C,MSG)</h2>
|
||||
<p>Expands to nothing if <code>C != 0</code> and to <code>MSG</code> if
|
||||
<code>C == 0</code>.</p>
|
||||
<h2><a name="BOOST_PP_ASSERT_MSG">#define BOOST_PP_ASSERT_MSG</a>(COND,MSG)</h2>
|
||||
<p>Expands to nothing if <code>COND != 0</code> and to <code>MSG</code> if
|
||||
<code>COND == 0</code>.</p>
|
||||
|
||||
<p><code>COND</code> must expand to an integer literal.</p>
|
||||
|
||||
<p>For example, <code><a href="assert_msg.htm#BOOST_PP_ASSERT_MSG">BOOST_PP_ASSERT_MSG</a>(1,A BUG!)</code> expands to <code>A BUG!</code>.</p>
|
||||
|
||||
|
@ -26,9 +26,11 @@
|
||||
|
||||
<hr>
|
||||
|
||||
<h2><a name="BOOST_PP_COMMA_IF">#define BOOST_PP_COMMA_IF</a>(C)</h2>
|
||||
<p>Expands to a comma if <code>C != 0</code> and nothing if
|
||||
<code>C == 0</code>.</p>
|
||||
<h2><a name="BOOST_PP_COMMA_IF">#define BOOST_PP_COMMA_IF</a>(COND)</h2>
|
||||
<p>Expands to a comma if <code>COND != 0</code> and nothing if
|
||||
<code>COND == 0</code>.</p>
|
||||
|
||||
<p><code>COND</code> must expand to an integer literal.</p>
|
||||
|
||||
<p>For example, <code><a href="comma_if.htm#BOOST_PP_COMMA_IF">BOOST_PP_COMMA_IF</a>(0)</code> expands to nothing.</p>
|
||||
|
||||
|
@ -30,6 +30,8 @@
|
||||
<p>Expands to <code>1</code> if <code>X == Y</code> and <code>0</code>
|
||||
otherwise.</p>
|
||||
|
||||
<p>Both <code>X</code> and <code>Y</code> must expand to integer literals.</p>
|
||||
|
||||
<p>For example, <code><a href="comparison_equal.htm#BOOST_PP_EQUAL">BOOST_PP_EQUAL</a>(4,4)</code> expands to <code>1</code>.</p>
|
||||
|
||||
<h3>Uses</h3>
|
||||
|
@ -30,6 +30,8 @@
|
||||
<p>Expands to <code>1</code> if <code>X > Y</code> and <code>0</code>
|
||||
otherwise.</p>
|
||||
|
||||
<p>Both <code>X</code> and <code>Y</code> must expand to integer literals.</p>
|
||||
|
||||
<p>For example, <code><a href="comparison_greater.htm#BOOST_PP_GREATER">BOOST_PP_GREATER</a>(4,3)</code> expands to <code>1</code>.</p>
|
||||
|
||||
<h3>Uses</h3>
|
||||
|
@ -30,6 +30,8 @@
|
||||
<p>Expands to <code>1</code> if <code>X >= Y</code> and <code>0</code>
|
||||
otherwise.</p>
|
||||
|
||||
<p>Both <code>X</code> and <code>Y</code> must expand to integer literals.</p>
|
||||
|
||||
<p>For example, <code><a href="comparison_greater_equal.htm#BOOST_PP_GREATER_EQUAL">BOOST_PP_GREATER_EQUAL</a>(1,3)</code> expands to <code>0</code>.</p>
|
||||
|
||||
<h3>Uses</h3>
|
||||
|
@ -30,6 +30,8 @@
|
||||
<p>Expands to <code>1</code> if <code>X < Y</code> and <code>0</code>
|
||||
otherwise.</p>
|
||||
|
||||
<p>Both <code>X</code> and <code>Y</code> must expand to integer literals.</p>
|
||||
|
||||
<p>For example, <code><a href="comparison_less.htm#BOOST_PP_LESS">BOOST_PP_LESS</a>(2,6)</code> expands to <code>1</code>.</p>
|
||||
|
||||
<h3>Uses</h3>
|
||||
|
@ -30,6 +30,8 @@
|
||||
<p>Expands to <code>1</code> if <code>X <= Y</code> and <code>0</code>
|
||||
otherwise.</p>
|
||||
|
||||
<p><code>X</code> must expand to an integer literal.</p>
|
||||
|
||||
<p>For example, <code><a href="comparison_less_equal.htm#BOOST_PP_LESS_EQUAL">BOOST_PP_LESS_EQUAL</a>(7,5)</code> expands to <code>0</code>.</p>
|
||||
|
||||
<h3>Uses</h3>
|
||||
|
@ -30,6 +30,8 @@
|
||||
<p>Expands to <code>1</code> if <code>X != Y</code> and <code>0</code>
|
||||
otherwise.</p>
|
||||
|
||||
<p>Both <code>X</code> and <code>Y</code> must expand to integer literals.</p>
|
||||
|
||||
<p>For example, <code><a href="comparison_not_equal.htm#BOOST_PP_NOT_EQUAL">BOOST_PP_NOT_EQUAL</a>(4,4)</code> expands to <code>0</code>.</p>
|
||||
|
||||
<h3>Uses</h3>
|
||||
|
@ -26,20 +26,20 @@
|
||||
|
||||
<hr>
|
||||
|
||||
<h2><a name="BOOST_PP_ENUM">#define BOOST_PP_ENUM</a>(N,F,P)</h2>
|
||||
<h2><a name="BOOST_PP_ENUM">#define BOOST_PP_ENUM</a>(COUNT,MACRO,DATA)</h2>
|
||||
<p>Generates a comma separated list.</p>
|
||||
|
||||
<p>In other words, expands to the sequence:</p>
|
||||
|
||||
<pre>
|
||||
F(0,P), F(1,P), ..., F(<a href="dec.htm#BOOST_PP_DEC">BOOST_PP_DEC</a>(N),P)
|
||||
MACRO(0,DATA), MACRO(1,DATA), ..., MACRO(<a href="dec.htm#BOOST_PP_DEC">BOOST_PP_DEC</a>(COUNT),DATA)
|
||||
</pre>
|
||||
|
||||
<p>For example,</p>
|
||||
|
||||
<pre>
|
||||
#define TYPED_PARAM(I,P)\
|
||||
<a href="cat.htm#BOOST_PP_CAT">BOOST_PP_CAT</a>(<a href="tuple_elem.htm#BOOST_PP_TUPLE_ELEM">BOOST_PP_TUPLE_ELEM</a>(2,0,P),I) <a href="cat.htm#BOOST_PP_CAT">BOOST_PP_CAT</a>(<a href="tuple_elem.htm#BOOST_PP_TUPLE_ELEM">BOOST_PP_TUPLE_ELEM</a>(2,1,P),I)
|
||||
#define TYPED_PARAM(INDEX,DATA)\
|
||||
<a href="cat.htm#BOOST_PP_CAT">BOOST_PP_CAT</a>(<a href="tuple_elem.htm#BOOST_PP_TUPLE_ELEM">BOOST_PP_TUPLE_ELEM</a>(2,0,DATA),INDEX) <a href="cat.htm#BOOST_PP_CAT">BOOST_PP_CAT</a>(<a href="tuple_elem.htm#BOOST_PP_TUPLE_ELEM">BOOST_PP_TUPLE_ELEM</a>(2,1,DATA),INDEX)
|
||||
<a href="enum.htm#BOOST_PP_ENUM">BOOST_PP_ENUM</a>(3,TYPED_PARAM,(X,x))
|
||||
</pre>
|
||||
|
||||
|
@ -26,13 +26,13 @@
|
||||
|
||||
<hr>
|
||||
|
||||
<h2><a name="BOOST_PP_ENUM_PARAMS">#define BOOST_PP_ENUM_PARAMS</a>(N,P)</h2>
|
||||
<h2><a name="BOOST_PP_ENUM_PARAMS">#define BOOST_PP_ENUM_PARAMS</a>(COUNT,PARAM)</h2>
|
||||
<p>Generates a comma separated list of parameters.</p>
|
||||
|
||||
<p>In other words, expands to the sequence:</p>
|
||||
|
||||
<pre>
|
||||
<a href="cat.htm#BOOST_PP_CAT">BOOST_PP_CAT</a>(P,0), <a href="cat.htm#BOOST_PP_CAT">BOOST_PP_CAT</a>(P,1), ..., <a href="cat.htm#BOOST_PP_CAT">BOOST_PP_CAT</a>(P,<a href="dec.htm#BOOST_PP_DEC">BOOST_PP_DEC</a>(N))
|
||||
<a href="cat.htm#BOOST_PP_CAT">BOOST_PP_CAT</a>(PARAM,0), <a href="cat.htm#BOOST_PP_CAT">BOOST_PP_CAT</a>(PARAM,1), ..., <a href="cat.htm#BOOST_PP_CAT">BOOST_PP_CAT</a>(PARAM,<a href="dec.htm#BOOST_PP_DEC">BOOST_PP_DEC</a>(COUNT))
|
||||
</pre>
|
||||
|
||||
<p>For example,</p>
|
||||
|
@ -26,13 +26,16 @@
|
||||
|
||||
<hr>
|
||||
|
||||
<h2><a name="BOOST_PP_ENUM_PARAMS_WITH_A_DEFAULT">#define BOOST_PP_ENUM_PARAMS_WITH_A_DEFAULT</a>(N,P,D)</h2>
|
||||
<h2><a name="BOOST_PP_ENUM_PARAMS_WITH_A_DEFAULT">#define BOOST_PP_ENUM_PARAMS_WITH_A_DEFAULT</a>(COUNT,PARAM,DEFAULT)</h2>
|
||||
<p>Generates a comma separated list of parameters with a default.</p>
|
||||
|
||||
<p>In other words, expands to the sequence:</p>
|
||||
|
||||
<pre>
|
||||
<a href="cat.htm#BOOST_PP_CAT">BOOST_PP_CAT</a>(P,0) = D, <a href="cat.htm#BOOST_PP_CAT">BOOST_PP_CAT</a>(P,1) = D, ..., <a href="cat.htm#BOOST_PP_CAT">BOOST_PP_CAT</a>(P,<a href="dec.htm#BOOST_PP_DEC">BOOST_PP_DEC</a>(N)) = D
|
||||
<a href="cat.htm#BOOST_PP_CAT">BOOST_PP_CAT</a>(PARAM,0) = DEFAULT,
|
||||
<a href="cat.htm#BOOST_PP_CAT">BOOST_PP_CAT</a>(PARAM,1) = DEFAULT,
|
||||
...,
|
||||
<a href="cat.htm#BOOST_PP_CAT">BOOST_PP_CAT</a>(PARAM,<a href="dec.htm#BOOST_PP_DEC">BOOST_PP_DEC</a>(COUNT)) = DEFAULT
|
||||
</pre>
|
||||
|
||||
<p>For example,</p>
|
||||
|
@ -26,16 +26,16 @@
|
||||
|
||||
<hr>
|
||||
|
||||
<h2><a name="BOOST_PP_ENUM_PARAMS_WITH_DEFAULTS">#define BOOST_PP_ENUM_PARAMS_WITH_DEFAULTS</a>(N,P,D)</h2>
|
||||
<h2><a name="BOOST_PP_ENUM_PARAMS_WITH_DEFAULTS">#define BOOST_PP_ENUM_PARAMS_WITH_DEFAULTS</a>(COUNT,PARAM,DEFAULT)</h2>
|
||||
<p>Generates a comma separated list of parameters with defaults.</p>
|
||||
|
||||
<p>In other words, expands to the sequence:</p>
|
||||
|
||||
<pre>
|
||||
<a href="cat.htm#BOOST_PP_CAT">BOOST_PP_CAT</a>(P,0) = <a href="cat.htm#BOOST_PP_CAT">BOOST_PP_CAT</a>(D,0),
|
||||
<a href="cat.htm#BOOST_PP_CAT">BOOST_PP_CAT</a>(P,1) = <a href="cat.htm#BOOST_PP_CAT">BOOST_PP_CAT</a>(D,1),
|
||||
<a href="cat.htm#BOOST_PP_CAT">BOOST_PP_CAT</a>(PARAM,0) = <a href="cat.htm#BOOST_PP_CAT">BOOST_PP_CAT</a>(DEFAULT,0),
|
||||
<a href="cat.htm#BOOST_PP_CAT">BOOST_PP_CAT</a>(PARAM,1) = <a href="cat.htm#BOOST_PP_CAT">BOOST_PP_CAT</a>(DEFAULT,1),
|
||||
...,
|
||||
<a href="cat.htm#BOOST_PP_CAT">BOOST_PP_CAT</a>(P,<a href="dec.htm#BOOST_PP_DEC">BOOST_PP_DEC</a>(N)) = <a href="cat.htm#BOOST_PP_CAT">BOOST_PP_CAT</a>(D,<a href="dec.htm#BOOST_PP_DEC">BOOST_PP_DEC</a>(N))
|
||||
<a href="cat.htm#BOOST_PP_CAT">BOOST_PP_CAT</a>(PARAM,<a href="dec.htm#BOOST_PP_DEC">BOOST_PP_DEC</a>(COUNT)) = <a href="cat.htm#BOOST_PP_CAT">BOOST_PP_CAT</a>(DEFAULT,<a href="dec.htm#BOOST_PP_DEC">BOOST_PP_DEC</a>(COUNT))
|
||||
</pre>
|
||||
|
||||
<p>For example,</p>
|
||||
|
@ -26,20 +26,20 @@
|
||||
|
||||
<hr>
|
||||
|
||||
<h2><a name="BOOST_PP_ENUM_SHIFTED">#define BOOST_PP_ENUM_SHIFTED</a>(N,F,P)</h2>
|
||||
<h2><a name="BOOST_PP_ENUM_SHIFTED">#define BOOST_PP_ENUM_SHIFTED</a>(COUNT,MACRO,DATA)</h2>
|
||||
<p>Generates a comma separated shifted list.</p>
|
||||
|
||||
<p>In other words, expands to the sequence:</p>
|
||||
|
||||
<pre>
|
||||
F(1,P), F(2,P), ..., F(<a href="dec.htm#BOOST_PP_DEC">BOOST_PP_DEC</a>(N),P)
|
||||
MACRO(1,DATA), MACRO(2,DATA), ..., MACRO(<a href="dec.htm#BOOST_PP_DEC">BOOST_PP_DEC</a>(COUNT),DATA)
|
||||
</pre>
|
||||
|
||||
<p>For example,</p>
|
||||
|
||||
<pre>
|
||||
#define TYPED_PARAM(I,P)\
|
||||
<a href="cat.htm#BOOST_PP_CAT">BOOST_PP_CAT</a>(<a href="tuple_elem.htm#BOOST_PP_TUPLE_ELEM">BOOST_PP_TUPLE_ELEM</a>(2,0,P),I) <a href="cat.htm#BOOST_PP_CAT">BOOST_PP_CAT</a>(<a href="tuple_elem.htm#BOOST_PP_TUPLE_ELEM">BOOST_PP_TUPLE_ELEM</a>(2,1,P),I)
|
||||
#define TYPED_PARAM(INDEX,DATA)\
|
||||
<a href="cat.htm#BOOST_PP_CAT">BOOST_PP_CAT</a>(<a href="tuple_elem.htm#BOOST_PP_TUPLE_ELEM">BOOST_PP_TUPLE_ELEM</a>(2,0,DATA),INDEX) <a href="cat.htm#BOOST_PP_CAT">BOOST_PP_CAT</a>(<a href="tuple_elem.htm#BOOST_PP_TUPLE_ELEM">BOOST_PP_TUPLE_ELEM</a>(2,1,DATA),INDEX)
|
||||
<a href="enum_shifted.htm#BOOST_PP_ENUM_SHIFTED">BOOST_PP_ENUM_SHIFTED</a>(3,TYPED_PARAM,(X,x))
|
||||
</pre>
|
||||
|
||||
|
@ -26,13 +26,13 @@
|
||||
|
||||
<hr>
|
||||
|
||||
<h2><a name="BOOST_PP_ENUM_SHIFTED_PARAMS">#define BOOST_PP_ENUM_SHIFTED_PARAMS</a>(N,P)</h2>
|
||||
<h2><a name="BOOST_PP_ENUM_SHIFTED_PARAMS">#define BOOST_PP_ENUM_SHIFTED_PARAMS</a>(COUNT,PARAM)</h2>
|
||||
<p>Generates a comma separated list of shifted actual parameters.</p>
|
||||
|
||||
<p>In other words, expands to the sequence:</p>
|
||||
|
||||
<pre>
|
||||
<a href="cat.htm#BOOST_PP_CAT">BOOST_PP_CAT</a>(P,1), <a href="cat.htm#BOOST_PP_CAT">BOOST_PP_CAT</a>(P,2), ..., <a href="cat.htm#BOOST_PP_CAT">BOOST_PP_CAT</a>(P,<a href="dec.htm#BOOST_PP_DEC">BOOST_PP_DEC</a>(N))
|
||||
<a href="cat.htm#BOOST_PP_CAT">BOOST_PP_CAT</a>(PARAM,1), <a href="cat.htm#BOOST_PP_CAT">BOOST_PP_CAT</a>(PARAM,2), ..., <a href="cat.htm#BOOST_PP_CAT">BOOST_PP_CAT</a>(PARAM,<a href="dec.htm#BOOST_PP_DEC">BOOST_PP_DEC</a>(COUNT))
|
||||
</pre>
|
||||
<p>For example,</p>
|
||||
|
||||
|
@ -26,8 +26,10 @@
|
||||
|
||||
<hr>
|
||||
|
||||
<h2><a name="BOOST_PP_EXPR_IF">#define BOOST_PP_EXPR_IF</a>(C,E)</h2>
|
||||
<p>Expands to <code>E</code> if <code>C != 0</code> and to nothing if <code>C == 0</code>.</p>
|
||||
<h2><a name="BOOST_PP_EXPR_IF">#define BOOST_PP_EXPR_IF</a>(COND,EXPR)</h2>
|
||||
<p>Expands to <code>EXPR</code> if <code>COND != 0</code> and to nothing if <code>COND == 0</code>.</p>
|
||||
|
||||
<p><code>COND</code> must expand to an integer literal.</p>
|
||||
|
||||
<p>For example, <code><a href="expr_if.htm#BOOST_PP_EXPR_IF">BOOST_PP_EXPR_IF</a>(1,^)</code> expands to <code>^</code>.</p>
|
||||
|
||||
|
@ -26,25 +26,25 @@
|
||||
|
||||
<hr>
|
||||
|
||||
<h2><a name="BOOST_PP_FOR">#define BOOST_PP_FOR</a>(X,C,F,I)</h2>
|
||||
<p>Repeats <code>I(R,X)</code> and iterates <code>F(R,X)</code> while
|
||||
<code>C(R,X)</code> is true.</p>
|
||||
<h2><a name="BOOST_PP_FOR">#define BOOST_PP_FOR</a>(STATE,PRED,OP,MACRO)</h2>
|
||||
<p>Repeats <code>MACRO(R,STATE)</code> and iterates <code>OP(R,STATE)</code> while
|
||||
<code>PRED(R,STATE)</code> is true.</p>
|
||||
|
||||
<p>In other words, expands to the sequence:</p>
|
||||
|
||||
<pre>
|
||||
I(R,X) I(R,F(R,X)) I(R,F(R,F(R,X))) ... I(R,F(R,F(...F(R,X)...)))
|
||||
MACRO(R,STATE) MACRO(R,OP(R,STATE)) MACRO(R,OP(R,OP(R,STATE))) ... MACRO(R,OP(R,OP(...OP(R,STATE)...)))
|
||||
</pre>
|
||||
|
||||
<p>The length of the sequence is determined by <code>C(R,X)</code>.</p>
|
||||
<p>The length of the sequence is determined by <code>PRED(R,STATE)</code>.</p>
|
||||
|
||||
<p>For example,</p>
|
||||
|
||||
<pre>
|
||||
#define C(R,X) <a href="comparison_less.htm#BOOST_PP_LESS">BOOST_PP_LESS</a>(<a href="tuple_elem.htm#BOOST_PP_TUPLE_ELEM">BOOST_PP_TUPLE_ELEM</a>(2,0,X),<a href="tuple_elem.htm#BOOST_PP_TUPLE_ELEM">BOOST_PP_TUPLE_ELEM</a>(2,1,X))
|
||||
#define F(R,X) (<a href="inc.htm#BOOST_PP_INC">BOOST_PP_INC</a>(<a href="tuple_elem.htm#BOOST_PP_TUPLE_ELEM">BOOST_PP_TUPLE_ELEM</a>(2,0,X)),<a href="tuple_elem.htm#BOOST_PP_TUPLE_ELEM">BOOST_PP_TUPLE_ELEM</a>(2,1,X))
|
||||
#define I(R,X) <a href="tuple_elem.htm#BOOST_PP_TUPLE_ELEM">BOOST_PP_TUPLE_ELEM</a>(2,0,X)
|
||||
<a href="for.htm#BOOST_PP_FOR">BOOST_PP_FOR</a>((0,3),C,F,I)
|
||||
#define PRED(R,STATE) <a href="comparison_less.htm#BOOST_PP_LESS">BOOST_PP_LESS</a>(<a href="tuple_elem.htm#BOOST_PP_TUPLE_ELEM">BOOST_PP_TUPLE_ELEM</a>(2,0,STATE),<a href="tuple_elem.htm#BOOST_PP_TUPLE_ELEM">BOOST_PP_TUPLE_ELEM</a>(2,1,STATE))
|
||||
#define OP(R,STATE) (<a href="inc.htm#BOOST_PP_INC">BOOST_PP_INC</a>(<a href="tuple_elem.htm#BOOST_PP_TUPLE_ELEM">BOOST_PP_TUPLE_ELEM</a>(2,0,STATE)),<a href="tuple_elem.htm#BOOST_PP_TUPLE_ELEM">BOOST_PP_TUPLE_ELEM</a>(2,1,STATE))
|
||||
#define MACRO(R,STATE) <a href="tuple_elem.htm#BOOST_PP_TUPLE_ELEM">BOOST_PP_TUPLE_ELEM</a>(2,0,STATE)
|
||||
<a href="for.htm#BOOST_PP_FOR">BOOST_PP_FOR</a>((0,3),PRED,OP,MACRO)
|
||||
</pre>
|
||||
|
||||
<p>expands to:</p>
|
||||
@ -55,19 +55,19 @@
|
||||
|
||||
<h3>Legend</h3>
|
||||
<ul>
|
||||
<li><b>X</b> is the current state of iteration. The state is usually a tuple.</li>
|
||||
<li><b>C</b> is the condition for iteration. It must expand to a decimal
|
||||
<li><b>STATE</b> is the current state of iteration. The state is usually a tuple.</li>
|
||||
<li><b>PRED</b> is the condition for iteration. It must expand to a decimal
|
||||
integer literal.</li>
|
||||
<li><b>F</b> is the iterated macro. Note that if the state is a tuple, then
|
||||
F(R,X) usually expands to a tuple of the same number of elements.</li>
|
||||
<li><b>I</b> is the state instantiation macro.</li>
|
||||
<li><b>OP</b> is the iterated macro. Note that if the state is a tuple, then
|
||||
OP(R,STATE) usually expands to a tuple of the same number of elements.</li>
|
||||
<li><b>MACRO</b> is the state instantiation macro.</li>
|
||||
<li><b>R</b> is the recursion depth and should only be used as a parameter to
|
||||
other macros using <a href="for.htm#BOOST_PP_FOR">BOOST_PP_FOR</a>() or for invoking <a href="for.htm#BOOST_PP_FOR">BOOST_PP_FOR</a>##R()
|
||||
directly. For each macro using <a href="for.htm#BOOST_PP_FOR">BOOST_PP_FOR</a>(), there is a version of the
|
||||
macro, distinguished by the R suffix, that accepts an additional
|
||||
recursion depth as the first parameter. This technique is necessary to
|
||||
avoid recursively expanding the same macro again, which is not permitted
|
||||
by the C++ preprocessor.</li>
|
||||
directly. For each macro using <a href="for.htm#BOOST_PP_FOR">BOOST_PP_FOR</a>(), e.g. <a href="list_for_each.htm#BOOST_PP_LIST_FOR_EACH">BOOST_PP_LIST_FOR_EACH</a>(),
|
||||
there is a version of the macro, e.g. <a href="list_for_each.htm#BOOST_PP_LIST_FOR_EACH_R">BOOST_PP_LIST_FOR_EACH_R</a>(), distinguished
|
||||
by the R suffix, that accepts an additional recursion depth as the first
|
||||
parameter. This technique is necessary to avoid recursively expanding the same
|
||||
macro again, which is not permitted by the C++ preprocessor.</li>
|
||||
</ul>
|
||||
|
||||
<h3><a href="repeat.htm#BOOST_PP_REPEAT">BOOST_PP_REPEAT</a>() vs <a href="for.htm#BOOST_PP_FOR">BOOST_PP_FOR</a>()</h3>
|
||||
|
@ -26,9 +26,11 @@
|
||||
|
||||
<hr>
|
||||
|
||||
<h2><a name="BOOST_PP_IF">#define BOOST_PP_IF</a>(C,T,E)</h2>
|
||||
<p>Expands to <code>T</code> if <code>C != 0</code> and <code>E</code> if
|
||||
<code>C == 0</code>.</p>
|
||||
<h2><a name="BOOST_PP_IF">#define BOOST_PP_IF</a>(COND,THEN,ELSE)</h2>
|
||||
<p>Expands to <code>THEN</code> if <code>COND != 0</code> and <code>ELSE</code> if
|
||||
<code>COND == 0</code>.</p>
|
||||
|
||||
<p><code>COND</code> must expand to an integer literal.</p>
|
||||
|
||||
<p>For example, <code><a href="if.htm#BOOST_PP_IF">BOOST_PP_IF</a>(0,1,2)</code> expands to <code>2</code>.</p>
|
||||
|
||||
|
@ -55,7 +55,7 @@ and <a href="repeat.htm#BOOST_PP_REPEAT">BOOST_PP_REPEAT</a> family).</p>
|
||||
<hr>
|
||||
|
||||
<h2><a name="BOOST_PP_LIMIT_TUPLE">#define BOOST_PP_LIMIT_TUPLE</a></h2>
|
||||
<p>Expands to the maximum tuple length supported by the library.</p>
|
||||
<p>Expands to the maximum tuple size supported by the library.</p>
|
||||
<hr>
|
||||
|
||||
<h2><a name="BOOST_PREPROCESSOR_LIMIT_DIM">#define BOOST_PREPROCESSOR_LIMIT_DIM</a></h2>
|
||||
|
@ -34,7 +34,7 @@
|
||||
|
||||
<hr>
|
||||
|
||||
<h2><a name="BOOST_PP_LIST_CONS">#define BOOST_PP_LIST_CONS</a>(H,T)</h2>
|
||||
<h2><a name="BOOST_PP_LIST_CONS">#define BOOST_PP_LIST_CONS</a>(FIRST,REST)</h2>
|
||||
<p>List constructor.</p>
|
||||
|
||||
<p>Lists are build using list constructors <a href="list_adt.htm#BOOST_PP_LIST_NIL">BOOST_PP_LIST_NIL</a> and
|
||||
@ -79,15 +79,15 @@ and <a href="list_fold_right_2nd.htm#BOOST_PP_LIST_FOLD_RIGHT_2ND">BOOST_PP_LIST
|
||||
<p>List nil constructor.</p>
|
||||
<hr>
|
||||
|
||||
<h2><a name="BOOST_PP_LIST_IS_CONS">#define BOOST_PP_LIST_IS_CONS</a>(L)</h2>
|
||||
<h2><a name="BOOST_PP_LIST_IS_CONS">#define BOOST_PP_LIST_IS_CONS</a>(LIST)</h2>
|
||||
<p>Expands to 1 if the list is not nil and 0 otherwise.</p>
|
||||
<hr>
|
||||
|
||||
<h2><a name="BOOST_PP_LIST_IS_NIL">#define BOOST_PP_LIST_IS_NIL</a>(L)</h2>
|
||||
<h2><a name="BOOST_PP_LIST_IS_NIL">#define BOOST_PP_LIST_IS_NIL</a>(LIST)</h2>
|
||||
<p>Expands to 1 if the list is nil and 0 otherwise.</p>
|
||||
<hr>
|
||||
|
||||
<h2><a name="BOOST_PP_LIST_FIRST">#define BOOST_PP_LIST_FIRST</a>(L)</h2>
|
||||
<h2><a name="BOOST_PP_LIST_FIRST">#define BOOST_PP_LIST_FIRST</a>(LIST)</h2>
|
||||
<p>Expands to the first element of the list. The list must not be nil.</p>
|
||||
|
||||
<p>For example,</p>
|
||||
@ -100,7 +100,7 @@ and <a href="list_fold_right_2nd.htm#BOOST_PP_LIST_FOLD_RIGHT_2ND">BOOST_PP_LIST
|
||||
|
||||
<hr>
|
||||
|
||||
<h2><a name="BOOST_PP_LIST_REST">#define BOOST_PP_LIST_REST</a>(L)</h2>
|
||||
<h2><a name="BOOST_PP_LIST_REST">#define BOOST_PP_LIST_REST</a>(LIST)</h2>
|
||||
<p>Expands to a list of all but the first element of the list.</p>
|
||||
|
||||
<p>The list must not be nil.</p>
|
||||
|
@ -26,7 +26,7 @@
|
||||
|
||||
<hr>
|
||||
|
||||
<h2><a name="BOOST_PP_LIST_APPEND">#define BOOST_PP_LIST_APPEND</a>(L,R)</h2>
|
||||
<h2><a name="BOOST_PP_LIST_APPEND">#define BOOST_PP_LIST_APPEND</a>(LIST_1ST,LIST_2ND)</h2>
|
||||
<p>Catenates two lists together.</p>
|
||||
|
||||
<p>For example,</p>
|
||||
@ -56,7 +56,7 @@
|
||||
|
||||
<hr>
|
||||
|
||||
<h2><a name="BOOST_PP_LIST_APPEND_D">#define BOOST_PP_LIST_APPEND_D</a>(D,L,R)</h2>
|
||||
<h2><a name="BOOST_PP_LIST_APPEND_D">#define BOOST_PP_LIST_APPEND_D</a>(D,LIST_1ST,LIST_2ND)</h2>
|
||||
<p>Can be used inside <a href="while.htm#BOOST_PP_WHILE">BOOST_PP_WHILE</a>().</p>
|
||||
<hr>
|
||||
|
||||
|
@ -26,8 +26,8 @@
|
||||
|
||||
<hr>
|
||||
|
||||
<h2><a name="BOOST_PP_LIST_AT">#define BOOST_PP_LIST_AT</a>(L,I)</h2>
|
||||
<p>Expands to the <code>I</code>:th element of the list <code>L</code>. The
|
||||
<h2><a name="BOOST_PP_LIST_AT">#define BOOST_PP_LIST_AT</a>(LIST,INDEX)</h2>
|
||||
<p>Expands to the <code>INDEX</code>:th element of the list <code>LIST</code>. The
|
||||
first element is at index <code>0</code>.</p>
|
||||
|
||||
<p>For example,</p>
|
||||
@ -50,7 +50,7 @@ first element is at index <code>0</code>.</p>
|
||||
|
||||
<hr>
|
||||
|
||||
<h2><a name="BOOST_PP_LIST_AT_D">#define BOOST_PP_LIST_AT_D</a>(D,L,I)</h2>
|
||||
<h2><a name="BOOST_PP_LIST_AT_D">#define BOOST_PP_LIST_AT_D</a>(D,LIST,INDEX)</h2>
|
||||
<p>Can be used inside <a href="while.htm#BOOST_PP_WHILE">BOOST_PP_WHILE</a>().</p>
|
||||
<hr>
|
||||
|
||||
|
@ -26,7 +26,7 @@
|
||||
|
||||
<hr>
|
||||
|
||||
<h2><a name="BOOST_PP_LIST_CAT">#define BOOST_PP_LIST_CAT</a>(L)</h2>
|
||||
<h2><a name="BOOST_PP_LIST_CAT">#define BOOST_PP_LIST_CAT</a>(LIST)</h2>
|
||||
<p>Catenates all elements of the list.</p>
|
||||
|
||||
<p>For example,</p>
|
||||
@ -53,7 +53,7 @@
|
||||
|
||||
<hr>
|
||||
|
||||
<h2><a name="BOOST_PP_LIST_CAT_D">#define BOOST_PP_LIST_CAT_D</a>(D,L)</h2>
|
||||
<h2><a name="BOOST_PP_LIST_CAT_D">#define BOOST_PP_LIST_CAT_D</a>(D,LIST)</h2>
|
||||
<p>Can be used inside <a href="while.htm#BOOST_PP_WHILE">BOOST_PP_WHILE</a>().</p>
|
||||
<hr>
|
||||
|
||||
|
@ -26,7 +26,7 @@
|
||||
|
||||
<hr>
|
||||
|
||||
<h2><a name="BOOST_PP_LIST_ENUM">#define BOOST_PP_LIST_ENUM</a>(L)</h2>
|
||||
<h2><a name="BOOST_PP_LIST_ENUM">#define BOOST_PP_LIST_ENUM</a>(LIST)</h2>
|
||||
<p>Converts the list to a comma separated list.</p>
|
||||
|
||||
<p>For example,</p>
|
||||
@ -48,7 +48,7 @@
|
||||
|
||||
<hr>
|
||||
|
||||
<h2><a name="BOOST_PP_LIST_ENUM_R">#define BOOST_PP_LIST_ENUM_R</a>(R,L)</h2>
|
||||
<h2><a name="BOOST_PP_LIST_ENUM_R">#define BOOST_PP_LIST_ENUM_R</a>(R,LIST)</h2>
|
||||
<p>Can be used inside <a href="for.htm#BOOST_PP_FOR">BOOST_PP_FOR</a>().</p>
|
||||
<hr>
|
||||
|
||||
|
@ -26,9 +26,9 @@
|
||||
|
||||
<hr>
|
||||
|
||||
<h2><a name="BOOST_PP_LIST_FILTER">#define BOOST_PP_LIST_FILTER</a>(F,P,L)</h2>
|
||||
<h2><a name="BOOST_PP_LIST_FILTER">#define BOOST_PP_LIST_FILTER</a>(PRED,DATA,LIST)</h2>
|
||||
<p>Expands to a list containing all the elements <code>X</code> of the list
|
||||
for which <code>F(D,P,X)</code> is true.</p>
|
||||
for which <code>PRED(D,DATA,X)</code> is true.</p>
|
||||
|
||||
<p>For example,</p>
|
||||
|
||||
@ -55,7 +55,7 @@ for which <code>F(D,P,X)</code> is true.</p>
|
||||
|
||||
<hr>
|
||||
|
||||
<h2><a name="BOOST_PP_LIST_FILTER_D">#define BOOST_PP_LIST_FILTER_D</a>(D,F,P,L)</h2>
|
||||
<h2><a name="BOOST_PP_LIST_FILTER_D">#define BOOST_PP_LIST_FILTER_D</a>(D,PRED,DATA,LIST)</h2>
|
||||
<p>Can be used inside <a href="while.htm#BOOST_PP_WHILE">BOOST_PP_WHILE</a>().</p>
|
||||
<hr>
|
||||
|
||||
|
@ -26,9 +26,9 @@
|
||||
|
||||
<hr>
|
||||
|
||||
<h2><a name="BOOST_PP_LIST_FIRST_N">#define BOOST_PP_LIST_FIRST_N</a>(N,L)</h2>
|
||||
<p>Expands to a list of the first <code>N</code> elements of the list
|
||||
<code>L</code>.</p>
|
||||
<h2><a name="BOOST_PP_LIST_FIRST_N">#define BOOST_PP_LIST_FIRST_N</a>(COUNT,LIST)</h2>
|
||||
<p>Expands to a list of the first <code>COUNT</code> elements of the list
|
||||
<code>LIST</code>.</p>
|
||||
|
||||
<p>For example,</p>
|
||||
|
||||
@ -59,7 +59,7 @@
|
||||
|
||||
<hr>
|
||||
|
||||
<h2><a name="BOOST_PP_LIST_FIRST_N_D">#define BOOST_PP_LIST_FIRST_N_D</a>(D,N,L)</h2>
|
||||
<h2><a name="BOOST_PP_LIST_FIRST_N_D">#define BOOST_PP_LIST_FIRST_N_D</a>(D,COUNT,LIST)</h2>
|
||||
<p>Can be used inside <a href="while.htm#BOOST_PP_WHILE">BOOST_PP_WHILE</a>().</p>
|
||||
<hr>
|
||||
|
||||
|
@ -26,24 +26,24 @@
|
||||
|
||||
<hr>
|
||||
|
||||
<h2><a name="BOOST_PP_LIST_FOLD_LEFT">#define BOOST_PP_LIST_FOLD_LEFT</a>(F,P,L)</h2>
|
||||
<p>Iterates <code>F(D,P,X)</code> for each element <code>X</code> of the
|
||||
list <code>L</code> (from the left or the start of the list).</p>
|
||||
<h2><a name="BOOST_PP_LIST_FOLD_LEFT">#define BOOST_PP_LIST_FOLD_LEFT</a>(OP,STATE,LIST)</h2>
|
||||
<p>Iterates <code>OP(D,STATE,X)</code> for each element <code>X</code> of the
|
||||
list <code>LIST</code> (from the left or the start of the list).</p>
|
||||
|
||||
<p>In other words, expands to:</p>
|
||||
|
||||
<pre>
|
||||
F
|
||||
OP
|
||||
( D
|
||||
, ... F(D, F(D,P,<a href="list_at.htm#BOOST_PP_LIST_AT">BOOST_PP_LIST_AT</a>(L,0)), <a href="list_at.htm#BOOST_PP_LIST_AT">BOOST_PP_LIST_AT</a>(L,1)) ...
|
||||
, <a href="list_at.htm#BOOST_PP_LIST_AT">BOOST_PP_LIST_AT</a>(L,<a href="dec.htm#BOOST_PP_DEC">BOOST_PP_DEC</a>(<a href="list_size.htm#BOOST_PP_LIST_SIZE">BOOST_PP_LIST_SIZE</a>(L))
|
||||
, ... OP(D, OP(D,STATE,<a href="list_at.htm#BOOST_PP_LIST_AT">BOOST_PP_LIST_AT</a>(LIST,0)), <a href="list_at.htm#BOOST_PP_LIST_AT">BOOST_PP_LIST_AT</a>(LIST,1)) ...
|
||||
, <a href="list_at.htm#BOOST_PP_LIST_AT">BOOST_PP_LIST_AT</a>(LIST,<a href="dec.htm#BOOST_PP_DEC">BOOST_PP_DEC</a>(<a href="list_size.htm#BOOST_PP_LIST_SIZE">BOOST_PP_LIST_SIZE</a>(LIST))
|
||||
)
|
||||
</pre>
|
||||
|
||||
<p>For example,</p>
|
||||
|
||||
<pre>
|
||||
#define TEST(D,P,X) <a href="cat.htm#BOOST_PP_CAT">BOOST_PP_CAT</a>(P,X)
|
||||
#define TEST(D,STATE,X) <a href="cat.htm#BOOST_PP_CAT">BOOST_PP_CAT</a>(STATE,X)
|
||||
<a href="list_fold_left.htm#BOOST_PP_LIST_FOLD_LEFT">BOOST_PP_LIST_FOLD_LEFT</a>(TEST,_,<a href="tuple_to_list.htm#BOOST_PP_TUPLE_TO_LIST">BOOST_PP_TUPLE_TO_LIST</a>(3,(A,B,C)))
|
||||
</pre>
|
||||
|
||||
@ -76,7 +76,7 @@ list <code>L</code> (from the left or the start of the list).</p>
|
||||
|
||||
<hr>
|
||||
|
||||
<h2><a name="BOOST_PP_LIST_FOLD_LEFT_D">#define BOOST_PP_LIST_FOLD_LEFT_D</a>(D,F,P,L)</h2>
|
||||
<h2><a name="BOOST_PP_LIST_FOLD_LEFT_D">#define BOOST_PP_LIST_FOLD_LEFT_D</a>(D,OP,STATE,LIST)</h2>
|
||||
<p>Can be used inside <a href="while.htm#BOOST_PP_WHILE">BOOST_PP_WHILE</a>().</p>
|
||||
<hr>
|
||||
|
||||
|
@ -26,11 +26,11 @@
|
||||
|
||||
<hr>
|
||||
|
||||
<h2><a name="BOOST_PP_LIST_FOLD_LEFT_2ND">#define BOOST_PP_LIST_FOLD_LEFT_2ND</a>(F,P,L)</h2>
|
||||
<h2><a name="BOOST_PP_LIST_FOLD_LEFT_2ND">#define BOOST_PP_LIST_FOLD_LEFT_2ND</a>(OP,STATE,LIST)</h2>
|
||||
<p>Same as <a href="list_fold_left.htm#BOOST_PP_LIST_FOLD_LEFT">BOOST_PP_LIST_FOLD_LEFT</a>(), but implemented independently.</p>
|
||||
<hr>
|
||||
|
||||
<h2><a name="BOOST_PP_LIST_FOLD_LEFT_2ND_D">#define BOOST_PP_LIST_FOLD_LEFT_2ND_D</a>(D,F,P,L)</h2>
|
||||
<h2><a name="BOOST_PP_LIST_FOLD_LEFT_2ND_D">#define BOOST_PP_LIST_FOLD_LEFT_2ND_D</a>(D,OP,STATE,LIST)</h2>
|
||||
<p>Can be used inside <a href="while.htm#BOOST_PP_WHILE">BOOST_PP_WHILE</a>().</p>
|
||||
<hr>
|
||||
|
||||
|
@ -26,23 +26,23 @@
|
||||
|
||||
<hr>
|
||||
|
||||
<h2><a name="BOOST_PP_LIST_FOLD_RIGHT">#define BOOST_PP_LIST_FOLD_RIGHT</a>(F,L,P)</h2>
|
||||
<p>Iterates <code>F(D,X,P)</code> for each element <code>X</code> of the
|
||||
list <code>L</code> (from the right or the end of the list).</p>
|
||||
<h2><a name="BOOST_PP_LIST_FOLD_RIGHT">#define BOOST_PP_LIST_FOLD_RIGHT</a>(OP,LIST,STATE)</h2>
|
||||
<p>Iterates <code>OP(D,X,STATE)</code> for each element <code>X</code> of the
|
||||
list <code>LIST</code> (from the right or the end of the list).</p>
|
||||
|
||||
<p>In other words, expands to:</p>
|
||||
|
||||
<pre>
|
||||
F
|
||||
OP
|
||||
( D
|
||||
, <a href="list_at.htm#BOOST_PP_LIST_AT">BOOST_PP_LIST_AT</a>(L,0)
|
||||
, ... F
|
||||
, <a href="list_at.htm#BOOST_PP_LIST_AT">BOOST_PP_LIST_AT</a>(LIST,0)
|
||||
, ... OP
|
||||
( D
|
||||
, <a href="list_at.htm#BOOST_PP_LIST_AT">BOOST_PP_LIST_AT</a>(L,<a href="arithmetic_sub.htm#BOOST_PP_SUB">BOOST_PP_SUB</a>(<a href="list_size.htm#BOOST_PP_LIST_SIZE">BOOST_PP_LIST_SIZE</a>(L),2))
|
||||
, F
|
||||
, <a href="list_at.htm#BOOST_PP_LIST_AT">BOOST_PP_LIST_AT</a>(LIST,<a href="arithmetic_sub.htm#BOOST_PP_SUB">BOOST_PP_SUB</a>(<a href="list_size.htm#BOOST_PP_LIST_SIZE">BOOST_PP_LIST_SIZE</a>(LIST),2))
|
||||
, OP
|
||||
( D
|
||||
, <a href="list_at.htm#BOOST_PP_LIST_AT">BOOST_PP_LIST_AT</a>(L,<a href="arithmetic_sub.htm#BOOST_PP_SUB">BOOST_PP_SUB</a>(<a href="list_size.htm#BOOST_PP_LIST_SIZE">BOOST_PP_LIST_SIZE</a>(L),1))
|
||||
, P
|
||||
, <a href="list_at.htm#BOOST_PP_LIST_AT">BOOST_PP_LIST_AT</a>(LIST,<a href="arithmetic_sub.htm#BOOST_PP_SUB">BOOST_PP_SUB</a>(<a href="list_size.htm#BOOST_PP_LIST_SIZE">BOOST_PP_LIST_SIZE</a>(LIST),1))
|
||||
, STATE
|
||||
)
|
||||
) ...
|
||||
)
|
||||
@ -51,7 +51,7 @@ list <code>L</code> (from the right or the end of the list).</p>
|
||||
<p>For example,</p>
|
||||
|
||||
<pre>
|
||||
#define TEST(D,X,P) <a href="cat.htm#BOOST_PP_CAT">BOOST_PP_CAT</a>(P,X)
|
||||
#define TEST(D,X,STATE) <a href="cat.htm#BOOST_PP_CAT">BOOST_PP_CAT</a>(STATE,X)
|
||||
<a href="list_fold_right.htm#BOOST_PP_LIST_FOLD_RIGHT">BOOST_PP_LIST_FOLD_RIGHT</a>(TEST,_,<a href="tuple_to_list.htm#BOOST_PP_TUPLE_TO_LIST">BOOST_PP_TUPLE_TO_LIST</a>(3,(A,B,C)))
|
||||
</pre>
|
||||
|
||||
@ -74,7 +74,7 @@ list <code>L</code> (from the right or the end of the list).</p>
|
||||
|
||||
<hr>
|
||||
|
||||
<h2><a name="BOOST_PP_LIST_FOLD_RIGHT_D">#define BOOST_PP_LIST_FOLD_RIGHT_D</a>(D,F,L,P)</h2>
|
||||
<h2><a name="BOOST_PP_LIST_FOLD_RIGHT_D">#define BOOST_PP_LIST_FOLD_RIGHT_D</a>(D,OP,LIST,STATE)</h2>
|
||||
<p>Can be used inside <a href="while.htm#BOOST_PP_WHILE">BOOST_PP_WHILE</a>().</p>
|
||||
<hr>
|
||||
|
||||
|
@ -26,11 +26,11 @@
|
||||
|
||||
<hr>
|
||||
|
||||
<h2><a name="BOOST_PP_LIST_FOLD_RIGHT_2ND">#define BOOST_PP_LIST_FOLD_RIGHT_2ND</a>(F,L,P)</h2>
|
||||
<h2><a name="BOOST_PP_LIST_FOLD_RIGHT_2ND">#define BOOST_PP_LIST_FOLD_RIGHT_2ND</a>(OP,LIST,STATE)</h2>
|
||||
<p>Same as <a href="list_fold_right.htm#BOOST_PP_LIST_FOLD_RIGHT">BOOST_PP_LIST_FOLD_RIGHT</a>(), but implemented independently.</p>
|
||||
<hr>
|
||||
|
||||
<h2><a name="BOOST_PP_LIST_FOLD_RIGHT_2ND_D">#define BOOST_PP_LIST_FOLD_RIGHT_2ND_D</a>(D,F,L,P)</h2>
|
||||
<h2><a name="BOOST_PP_LIST_FOLD_RIGHT_2ND_D">#define BOOST_PP_LIST_FOLD_RIGHT_2ND_D</a>(D,OP,LIST,STATE)</h2>
|
||||
<p>Can be used inside <a href="while.htm#BOOST_PP_WHILE">BOOST_PP_WHILE</a>().</p>
|
||||
<hr>
|
||||
|
||||
|
@ -26,23 +26,23 @@
|
||||
|
||||
<hr>
|
||||
|
||||
<h2><a name="BOOST_PP_LIST_FOR_EACH">#define BOOST_PP_LIST_FOR_EACH</a>(F,P,L)</h2>
|
||||
<p>Repeats <code>F(R,P,<a href="list_at.htm#BOOST_PP_LIST_AT">BOOST_PP_LIST_AT</a>(L,I))</code> for each I = [0,
|
||||
<a href="list_size.htm#BOOST_PP_LIST_SIZE">BOOST_PP_LIST_SIZE</a>(L)[.</p>
|
||||
<h2><a name="BOOST_PP_LIST_FOR_EACH">#define BOOST_PP_LIST_FOR_EACH</a>(MACRO,DATA,LIST)</h2>
|
||||
<p>Repeats <code>MACRO(R,DATA,<a href="list_at.htm#BOOST_PP_LIST_AT">BOOST_PP_LIST_AT</a>(LIST,INDEX))</code> for each INDEX = [0,
|
||||
<a href="list_size.htm#BOOST_PP_LIST_SIZE">BOOST_PP_LIST_SIZE</a>(LIST)[.</p>
|
||||
|
||||
<p>In other words, expands to the sequence:</p>
|
||||
|
||||
<pre>
|
||||
F(R,P,<a href="list_at.htm#BOOST_PP_LIST_AT">BOOST_PP_LIST_AT</a>(L,0))
|
||||
F(R,P,<a href="list_at.htm#BOOST_PP_LIST_AT">BOOST_PP_LIST_AT</a>(L,1))
|
||||
MACRO(R,DATA,<a href="list_at.htm#BOOST_PP_LIST_AT">BOOST_PP_LIST_AT</a>(LIST,0))
|
||||
MACRO(R,DATA,<a href="list_at.htm#BOOST_PP_LIST_AT">BOOST_PP_LIST_AT</a>(LIST,1))
|
||||
...
|
||||
F(R,P,<a href="list_at.htm#BOOST_PP_LIST_AT">BOOST_PP_LIST_AT</a>(L,<a href="dec.htm#BOOST_PP_DEC">BOOST_PP_DEC</a>(<a href="list_size.htm#BOOST_PP_LIST_SIZE">BOOST_PP_LIST_SIZE</a>(L))))
|
||||
MACRO(R,DATA,<a href="list_at.htm#BOOST_PP_LIST_AT">BOOST_PP_LIST_AT</a>(LIST,<a href="dec.htm#BOOST_PP_DEC">BOOST_PP_DEC</a>(<a href="list_size.htm#BOOST_PP_LIST_SIZE">BOOST_PP_LIST_SIZE</a>(LIST))))
|
||||
</pre>
|
||||
|
||||
<p>For example,</p>
|
||||
|
||||
<pre>
|
||||
#define TEST(R,P,X) <a href="cat.htm#BOOST_PP_CAT">BOOST_PP_CAT</a>(P,X)();
|
||||
#define TEST(R,DATA,X) <a href="cat.htm#BOOST_PP_CAT">BOOST_PP_CAT</a>(DATA,X)();
|
||||
<a href="list_for_each.htm#BOOST_PP_LIST_FOR_EACH">BOOST_PP_LIST_FOR_EACH</a>(TEST,prefix_,<a href="tuple_to_list.htm#BOOST_PP_TUPLE_TO_LIST">BOOST_PP_TUPLE_TO_LIST</a>(3,(A,B,C)))
|
||||
</pre>
|
||||
|
||||
@ -70,7 +70,7 @@
|
||||
|
||||
<hr>
|
||||
|
||||
<h2><a name="BOOST_PP_LIST_FOR_EACH_R">#define BOOST_PP_LIST_FOR_EACH_R</a>(R,F,P,L)</h2>
|
||||
<h2><a name="BOOST_PP_LIST_FOR_EACH_R">#define BOOST_PP_LIST_FOR_EACH_R</a>(R,MACRO,DATA,LIST)</h2>
|
||||
<p>Can be used inside <a href="for.htm#BOOST_PP_FOR">BOOST_PP_FOR</a>().</p>
|
||||
<hr>
|
||||
|
||||
|
@ -26,23 +26,23 @@
|
||||
|
||||
<hr>
|
||||
|
||||
<h2><a name="BOOST_PP_LIST_FOR_EACH_I">#define BOOST_PP_LIST_FOR_EACH_I</a>(F,P,L)</h2>
|
||||
<p>Repeats <code>F(R,P,I,<a href="list_at.htm#BOOST_PP_LIST_AT">BOOST_PP_LIST_AT</a>(L,I))</code> for each I = [0,
|
||||
<a href="list_size.htm#BOOST_PP_LIST_SIZE">BOOST_PP_LIST_SIZE</a>(L)[.</p>
|
||||
<h2><a name="BOOST_PP_LIST_FOR_EACH_I">#define BOOST_PP_LIST_FOR_EACH_I</a>(MACRO,DATA,LIST)</h2>
|
||||
<p>Repeats <code>MACRO(R,DATA,INDEX,<a href="list_at.htm#BOOST_PP_LIST_AT">BOOST_PP_LIST_AT</a>(LIST,INDEX))</code> for each INDEX = [0,
|
||||
<a href="list_size.htm#BOOST_PP_LIST_SIZE">BOOST_PP_LIST_SIZE</a>(LIST)[.</p>
|
||||
|
||||
<p>In other words, expands to the sequence:</p>
|
||||
|
||||
<pre>
|
||||
F(R,P,0,<a href="list_at.htm#BOOST_PP_LIST_AT">BOOST_PP_LIST_AT</a>(L,0))
|
||||
F(R,P,1,<a href="list_at.htm#BOOST_PP_LIST_AT">BOOST_PP_LIST_AT</a>(L,1))
|
||||
MACRO(R,DATA,0,<a href="list_at.htm#BOOST_PP_LIST_AT">BOOST_PP_LIST_AT</a>(LIST,0))
|
||||
MACRO(R,DATA,1,<a href="list_at.htm#BOOST_PP_LIST_AT">BOOST_PP_LIST_AT</a>(LIST,1))
|
||||
...
|
||||
F(R,P,<a href="dec.htm#BOOST_PP_DEC">BOOST_PP_DEC</a>(<a href="list_size.htm#BOOST_PP_LIST_SIZE">BOOST_PP_LIST_SIZE</a>(L)),<a href="list_at.htm#BOOST_PP_LIST_AT">BOOST_PP_LIST_AT</a>(L,<a href="dec.htm#BOOST_PP_DEC">BOOST_PP_DEC</a>(<a href="list_size.htm#BOOST_PP_LIST_SIZE">BOOST_PP_LIST_SIZE</a>(L))))
|
||||
MACRO(R,DATA,<a href="dec.htm#BOOST_PP_DEC">BOOST_PP_DEC</a>(<a href="list_size.htm#BOOST_PP_LIST_SIZE">BOOST_PP_LIST_SIZE</a>(LIST)),<a href="list_at.htm#BOOST_PP_LIST_AT">BOOST_PP_LIST_AT</a>(LIST,<a href="dec.htm#BOOST_PP_DEC">BOOST_PP_DEC</a>(<a href="list_size.htm#BOOST_PP_LIST_SIZE">BOOST_PP_LIST_SIZE</a>(LIST))))
|
||||
</pre>
|
||||
|
||||
<p>For example,</p>
|
||||
|
||||
<pre>
|
||||
#define TEST(R,P,I,X) <a href="cat.htm#BOOST_PP_CAT">BOOST_PP_CAT</a>(P,X)(I);
|
||||
#define TEST(R,DATA,INDEX,X) <a href="cat.htm#BOOST_PP_CAT">BOOST_PP_CAT</a>(DATA,X)(INDEX);
|
||||
<a href="list_for_each_i.htm#BOOST_PP_LIST_FOR_EACH_I">BOOST_PP_LIST_FOR_EACH_I</a>(TEST,prefix_,<a href="tuple_to_list.htm#BOOST_PP_TUPLE_TO_LIST">BOOST_PP_TUPLE_TO_LIST</a>(3,(A,B,C)))
|
||||
</pre>
|
||||
|
||||
@ -59,7 +59,7 @@
|
||||
|
||||
<hr>
|
||||
|
||||
<h2><a name="BOOST_PP_LIST_FOR_EACH_I_R">#define BOOST_PP_LIST_FOR_EACH_I_R</a>(R,F,P,L)</h2>
|
||||
<h2><a name="BOOST_PP_LIST_FOR_EACH_I_R">#define BOOST_PP_LIST_FOR_EACH_I_R</a>(R,MACRO,DATA,LIST)</h2>
|
||||
<p>Can be used inside <a href="for.htm#BOOST_PP_FOR">BOOST_PP_FOR</a>().</p>
|
||||
<hr>
|
||||
|
||||
|
@ -26,9 +26,9 @@
|
||||
|
||||
<hr>
|
||||
|
||||
<h2><a name="BOOST_PP_LIST_FOR_EACH_PRODUCT">#define BOOST_PP_LIST_FOR_EACH_PRODUCT</a>(F,N,T_OF_L)</h2>
|
||||
<p>Repeats <code>F(R,X)</code> for each element <code>X</code> of the
|
||||
cartesian product of the lists of the <code>N</code>-tuple <code>T_OF_L</code>.</p>
|
||||
<h2><a name="BOOST_PP_LIST_FOR_EACH_PRODUCT">#define BOOST_PP_LIST_FOR_EACH_PRODUCT</a>(MACRO,SIZE_OF_TUPLE,TUPLE_OF_LISTS)</h2>
|
||||
<p>Repeats <code>MACRO(R,X)</code> for each element <code>X</code> of the
|
||||
cartesian product of the lists of the <code>SIZE_OF_TUPLE</code>-tuple <code>TUPLE_OF_LISTS</code>.</p>
|
||||
|
||||
<p>This macro is useful for generating code to avoid combinatorial
|
||||
explosion.</p>
|
||||
@ -70,7 +70,7 @@ explosion.</p>
|
||||
|
||||
<hr>
|
||||
|
||||
<h2><a name="BOOST_PP_LIST_FOR_EACH_PRODUCT_R">#define BOOST_PP_LIST_FOR_EACH_PRODUCT_R</a>(R,F,N,T_OF_L)</h2>
|
||||
<h2><a name="BOOST_PP_LIST_FOR_EACH_PRODUCT_R">#define BOOST_PP_LIST_FOR_EACH_PRODUCT_R</a>(R,MACRO,SIZE_OF_TUPLE,TUPLE_OF_LISTS)</h2>
|
||||
<p>Can be used inside <a href="for.htm#BOOST_PP_FOR">BOOST_PP_FOR</a>().</p>
|
||||
<hr>
|
||||
|
||||
|
@ -26,9 +26,9 @@
|
||||
|
||||
<hr>
|
||||
|
||||
<h2><a name="BOOST_PP_LIST_REST_N">#define BOOST_PP_LIST_REST_N</a>(N,L)</h2>
|
||||
<p>Expands to a list of all but the first <code>N</code> elements of the
|
||||
list <code>L</code>.</p>
|
||||
<h2><a name="BOOST_PP_LIST_REST_N">#define BOOST_PP_LIST_REST_N</a>(COUNT,LIST)</h2>
|
||||
<p>Expands to a list of all but the first <code>COUNT</code> elements of the
|
||||
list <code>LIST</code>.</p>
|
||||
|
||||
<p>For example,</p>
|
||||
|
||||
@ -59,7 +59,7 @@ list <code>L</code>.</p>
|
||||
|
||||
<hr>
|
||||
|
||||
<h2><a name="BOOST_PP_LIST_REST_N_D">#define BOOST_PP_LIST_REST_N_D</a>(D,N,L)</h2>
|
||||
<h2><a name="BOOST_PP_LIST_REST_N_D">#define BOOST_PP_LIST_REST_N_D</a>(D,COUNT,LIST)</h2>
|
||||
<p>Can be used inside <a href="while.htm#BOOST_PP_WHILE">BOOST_PP_WHILE</a>().</p>
|
||||
<hr>
|
||||
|
||||
|
@ -26,7 +26,7 @@
|
||||
|
||||
<hr>
|
||||
|
||||
<h2><a name="BOOST_PP_LIST_REVERSE">#define BOOST_PP_LIST_REVERSE</a>(L)</h2>
|
||||
<h2><a name="BOOST_PP_LIST_REVERSE">#define BOOST_PP_LIST_REVERSE</a>(LIST)</h2>
|
||||
<p>List reversal.</p>
|
||||
|
||||
<p>For example,</p>
|
||||
@ -53,7 +53,7 @@
|
||||
|
||||
<hr>
|
||||
|
||||
<h2><a name="BOOST_PP_LIST_REVERSE_D">#define BOOST_PP_LIST_REVERSE_D</a>(D,L)</h2>
|
||||
<h2><a name="BOOST_PP_LIST_REVERSE_D">#define BOOST_PP_LIST_REVERSE_D</a>(D,LIST)</h2>
|
||||
<p>Can be used inside <a href="while.htm#BOOST_PP_WHILE">BOOST_PP_WHILE</a>().</p>
|
||||
<hr>
|
||||
|
||||
|
@ -26,7 +26,7 @@
|
||||
|
||||
<hr>
|
||||
|
||||
<h2><a name="BOOST_PP_LIST_SIZE">#define BOOST_PP_LIST_SIZE</a>(L)</h2>
|
||||
<h2><a name="BOOST_PP_LIST_SIZE">#define BOOST_PP_LIST_SIZE</a>(LIST)</h2>
|
||||
<p>Expands to the number of elements in the list.</p>
|
||||
|
||||
<p>For example,</p>
|
||||
@ -49,7 +49,7 @@
|
||||
|
||||
<hr>
|
||||
|
||||
<h2><a name="BOOST_PP_LIST_SIZE_D">#define BOOST_PP_LIST_SIZE_D</a>(D,L)</h2>
|
||||
<h2><a name="BOOST_PP_LIST_SIZE_D">#define BOOST_PP_LIST_SIZE_D</a>(D,LIST)</h2>
|
||||
<p>Can be used inside <a href="while.htm#BOOST_PP_WHILE">BOOST_PP_WHILE</a>().</p>
|
||||
<hr>
|
||||
|
||||
|
@ -26,7 +26,7 @@
|
||||
|
||||
<hr>
|
||||
|
||||
<h2><a name="BOOST_PP_LIST_TO_TUPLE">#define BOOST_PP_LIST_TO_TUPLE</a>(L)</h2>
|
||||
<h2><a name="BOOST_PP_LIST_TO_TUPLE">#define BOOST_PP_LIST_TO_TUPLE</a>(LIST)</h2>
|
||||
<p>Converts the list to a tuple.</p>
|
||||
|
||||
<p>For example,</p>
|
||||
@ -55,7 +55,7 @@
|
||||
|
||||
<hr>
|
||||
|
||||
<h2><a name="BOOST_PP_LIST_TO_TUPLE_R">#define BOOST_PP_LIST_TO_TUPLE_R</a>(R,L)</h2>
|
||||
<h2><a name="BOOST_PP_LIST_TO_TUPLE_R">#define BOOST_PP_LIST_TO_TUPLE_R</a>(R,LIST)</h2>
|
||||
<p>Can be used inside <a href="for.htm#BOOST_PP_FOR">BOOST_PP_FOR</a>().</p>
|
||||
<hr>
|
||||
|
||||
|
@ -26,17 +26,17 @@
|
||||
|
||||
<hr>
|
||||
|
||||
<h2><a name="BOOST_PP_LIST_TRANSFORM">#define BOOST_PP_LIST_TRANSFORM</a>(F,P,L)</h2>
|
||||
<p>Applies the macro <code>F(D,P,X)</code> to each element <code>X</code>
|
||||
<h2><a name="BOOST_PP_LIST_TRANSFORM">#define BOOST_PP_LIST_TRANSFORM</a>(OP,DATA,LIST)</h2>
|
||||
<p>Applies the macro <code>OP(D,DATA,X)</code> to each element <code>X</code>
|
||||
of the list producing a new list.</p>
|
||||
|
||||
<p>In other words, expands to:</p>
|
||||
|
||||
<pre>
|
||||
<a href="list_adt.htm#BOOST_PP_LIST_CONS">BOOST_PP_LIST_CONS</a>(F(D,P,<a href="list_at.htm#BOOST_PP_LIST_AT">BOOST_PP_LIST_AT</a>(L,0)),
|
||||
<a href="list_adt.htm#BOOST_PP_LIST_CONS">BOOST_PP_LIST_CONS</a>(F(D,P,<a href="list_at.htm#BOOST_PP_LIST_AT">BOOST_PP_LIST_AT</a>(L,1)),
|
||||
<a href="list_adt.htm#BOOST_PP_LIST_CONS">BOOST_PP_LIST_CONS</a>(OP(D,DATA,<a href="list_at.htm#BOOST_PP_LIST_AT">BOOST_PP_LIST_AT</a>(LIST,0)),
|
||||
<a href="list_adt.htm#BOOST_PP_LIST_CONS">BOOST_PP_LIST_CONS</a>(OP(D,DATA,<a href="list_at.htm#BOOST_PP_LIST_AT">BOOST_PP_LIST_AT</a>(LIST,1)),
|
||||
...
|
||||
<a href="list_adt.htm#BOOST_PP_LIST_CONS">BOOST_PP_LIST_CONS</a>(F(D,P,<a href="list_at.htm#BOOST_PP_LIST_AT">BOOST_PP_LIST_AT</a>(L,<a href="dec.htm#BOOST_PP_DEC">BOOST_PP_DEC</a>(<a href="list_size.htm#BOOST_PP_LIST_SIZE">BOOST_PP_LIST_SIZE</a>(L)))),
|
||||
<a href="list_adt.htm#BOOST_PP_LIST_CONS">BOOST_PP_LIST_CONS</a>(OP(D,DATA,<a href="list_at.htm#BOOST_PP_LIST_AT">BOOST_PP_LIST_AT</a>(LIST,<a href="dec.htm#BOOST_PP_DEC">BOOST_PP_DEC</a>(<a href="list_size.htm#BOOST_PP_LIST_SIZE">BOOST_PP_LIST_SIZE</a>(LIST)))),
|
||||
<a href="list_adt.htm#BOOST_PP_LIST_NIL">BOOST_PP_LIST_NIL</a>) ... ))
|
||||
</pre>
|
||||
|
||||
@ -65,7 +65,7 @@ of the list producing a new list.</p>
|
||||
|
||||
<hr>
|
||||
|
||||
<h2><a name="BOOST_PP_LIST_TRANSFORM_D">#define BOOST_PP_LIST_TRANSFORM_D</a>(D,F,P,L)</h2>
|
||||
<h2><a name="BOOST_PP_LIST_TRANSFORM_D">#define BOOST_PP_LIST_TRANSFORM_D</a>(D,OP,DATA,LIST)</h2>
|
||||
<p>Can be used inside <a href="while.htm#BOOST_PP_WHILE">BOOST_PP_WHILE</a>().</p>
|
||||
<hr>
|
||||
|
||||
|
@ -26,19 +26,19 @@
|
||||
|
||||
<hr>
|
||||
|
||||
<h2><a name="BOOST_PP_REPEAT">#define BOOST_PP_REPEAT</a>(N,M,P)</h2>
|
||||
<p>Repeats the macro <code>M(I,P)</code> for <code>I = [0,N[</code>.</p>
|
||||
<h2><a name="BOOST_PP_REPEAT">#define BOOST_PP_REPEAT</a>(COUNT,MACRO,DATA)</h2>
|
||||
<p>Repeats the macro <code>MACRO(INDEX,DATA)</code> for <code>INDEX = [0,COUNT[</code>.</p>
|
||||
|
||||
<p>In other words, expands to the sequence:</p>
|
||||
|
||||
<pre>
|
||||
M(0,P) M(1,P) ... M(<a href="dec.htm#BOOST_PP_DEC">BOOST_PP_DEC</a>(N),P)
|
||||
MACRO(0,DATA) MACRO(1,DATA) ... MACRO(<a href="dec.htm#BOOST_PP_DEC">BOOST_PP_DEC</a>(COUNT),DATA)
|
||||
</pre>
|
||||
|
||||
<p>For example,</p>
|
||||
|
||||
<pre>
|
||||
#define TEST(I,P) P(I);
|
||||
#define TEST(INDEX,DATA) DATA(INDEX);
|
||||
<a href="repeat.htm#BOOST_PP_REPEAT">BOOST_PP_REPEAT</a>(3,TEST,X)
|
||||
</pre>
|
||||
|
||||
|
@ -26,7 +26,7 @@
|
||||
|
||||
<hr>
|
||||
|
||||
<h2><a name="BOOST_PP_REPEAT_2ND">#define BOOST_PP_REPEAT_2ND</a>(N,M,P)</h2>
|
||||
<h2><a name="BOOST_PP_REPEAT_2ND">#define BOOST_PP_REPEAT_2ND</a>(COUNT,MACRO,DATA)</h2>
|
||||
<p>Same as <a href="repeat.htm#BOOST_PP_REPEAT">BOOST_PP_REPEAT</a>(), but implemented independently.</p>
|
||||
|
||||
<h3>Test</h3>
|
||||
|
@ -26,7 +26,7 @@
|
||||
|
||||
<hr>
|
||||
|
||||
<h2><a name="BOOST_PP_REPEAT_3RD">#define BOOST_PP_REPEAT_3RD</a>(N,M,P)</h2>
|
||||
<h2><a name="BOOST_PP_REPEAT_3RD">#define BOOST_PP_REPEAT_3RD</a>(COUNT,MACRO,DATA)</h2>
|
||||
<p>Same as <a href="repeat.htm#BOOST_PP_REPEAT">BOOST_PP_REPEAT</a>(), but implemented independently.</p>
|
||||
<hr>
|
||||
|
||||
|
@ -26,19 +26,19 @@
|
||||
|
||||
<hr>
|
||||
|
||||
<h2><a name="BOOST_PP_REPEAT_FROM_TO">#define BOOST_PP_REPEAT_FROM_TO</a>(S,E,M,P)</h2>
|
||||
<p>Repeats the macro <code>M(I,P)</code> for <code>I = [S,E[</code>.</p>
|
||||
<h2><a name="BOOST_PP_REPEAT_FROM_TO">#define BOOST_PP_REPEAT_FROM_TO</a>(FIRST,LAST,MACRO,DATA)</h2>
|
||||
<p>Repeats the macro <code>MACRO(INDEX,DATA)</code> for <code>INDEX = [FIRST,LAST[</code>.</p>
|
||||
|
||||
<p>In other words, expands to the sequence:</p>
|
||||
|
||||
<pre>
|
||||
M(S,P) M(<a href="inc.htm#BOOST_PP_INC">BOOST_PP_INC</a>(S),P) ... M(<a href="dec.htm#BOOST_PP_DEC">BOOST_PP_DEC</a>(E),P)
|
||||
MACRO(FIRST,DATA) MACRO(<a href="inc.htm#BOOST_PP_INC">BOOST_PP_INC</a>(FIRST),DATA) ... MACRO(<a href="dec.htm#BOOST_PP_DEC">BOOST_PP_DEC</a>(LAST),DATA)
|
||||
</pre>
|
||||
|
||||
<p>For example,</p>
|
||||
|
||||
<pre>
|
||||
#define TEST(I,P) P(I);
|
||||
#define TEST(INDEX,DATA) DATA(INDEX);
|
||||
<a href="repeat_from_to.htm#BOOST_PP_REPEAT_FROM_TO">BOOST_PP_REPEAT_FROM_TO</a>(4,7,TEST,X)
|
||||
</pre>
|
||||
|
||||
|
@ -26,7 +26,7 @@
|
||||
|
||||
<hr>
|
||||
|
||||
<h2><a name="BOOST_PP_REPEAT_FROM_TO_2ND">#define BOOST_PP_REPEAT_FROM_TO_2ND</a>(S,E,M,P)</h2>
|
||||
<h2><a name="BOOST_PP_REPEAT_FROM_TO_2ND">#define BOOST_PP_REPEAT_FROM_TO_2ND</a>(FIRST,LAST,MACRO,DATA)</h2>
|
||||
<p>Same as <a href="repeat_from_to.htm#BOOST_PP_REPEAT_FROM_TO">BOOST_PP_REPEAT_FROM_TO</a>(), but implemented independently.</p>
|
||||
<hr>
|
||||
|
||||
|
@ -26,7 +26,7 @@
|
||||
|
||||
<hr>
|
||||
|
||||
<h2><a name="BOOST_PP_REPEAT_FROM_TO_3RD">#define BOOST_PP_REPEAT_FROM_TO_3RD</a>(S,E,M,P)</h2>
|
||||
<h2><a name="BOOST_PP_REPEAT_FROM_TO_3RD">#define BOOST_PP_REPEAT_FROM_TO_3RD</a>(FIRST,LAST,MACRO,DATA)</h2>
|
||||
<p>Same as <a href="repeat_from_to.htm#BOOST_PP_REPEAT_FROM_TO">BOOST_PP_REPEAT_FROM_TO</a>(), but implemented independently.</p>
|
||||
<hr>
|
||||
|
||||
|
@ -26,8 +26,8 @@
|
||||
|
||||
<hr>
|
||||
|
||||
<h2><a name="BOOST_PP_TUPLE_EAT">#define BOOST_PP_TUPLE_EAT</a>(N)</h2>
|
||||
<p>Expands to a macro that eats a tuple of the specified length.</p>
|
||||
<h2><a name="BOOST_PP_TUPLE_EAT">#define BOOST_PP_TUPLE_EAT</a>(SIZE_OF_TUPLE)</h2>
|
||||
<p>Expands to a macro that eats a tuple of the specified size.</p>
|
||||
|
||||
<p><a href="tuple_eat.htm#BOOST_PP_TUPLE_EAT">BOOST_PP_TUPLE_EAT</a>() is designed to be used with <a href="if.htm#BOOST_PP_IF">BOOST_PP_IF</a>() like
|
||||
<a href="empty.htm#BOOST_PP_EMPTY">BOOST_PP_EMPTY</a>().</p>
|
||||
|
@ -26,8 +26,8 @@
|
||||
|
||||
<hr>
|
||||
|
||||
<h2><a name="BOOST_PP_TUPLE_ELEM">#define BOOST_PP_TUPLE_ELEM</a>(N,I,T)</h2>
|
||||
<p>Expands to the <code>I</code>:th element of an <code>N</code>-tuple.</p>
|
||||
<h2><a name="BOOST_PP_TUPLE_ELEM">#define BOOST_PP_TUPLE_ELEM</a>(SIZE_OF_TUPLE,INDEX,TUPLE)</h2>
|
||||
<p>Expands to the <code>INDEX</code>:th element of an <code>SIZE_OF_TUPLE</code>-tuple.</p>
|
||||
|
||||
<p>For example,</p>
|
||||
|
||||
|
@ -26,7 +26,7 @@
|
||||
|
||||
<hr>
|
||||
|
||||
<h2><a name="BOOST_PP_TUPLE_REVERSE">#define BOOST_PP_TUPLE_REVERSE</a>(N,T)</h2>
|
||||
<h2><a name="BOOST_PP_TUPLE_REVERSE">#define BOOST_PP_TUPLE_REVERSE</a>(SIZE_OF_TUPLE,TUPLE)</h2>
|
||||
<p>Tuple reversal.</p>
|
||||
|
||||
<p>For example,</p>
|
||||
|
@ -26,7 +26,7 @@
|
||||
|
||||
<hr>
|
||||
|
||||
<h2><a name="BOOST_PP_TUPLE_TO_LIST">#define BOOST_PP_TUPLE_TO_LIST</a>(N,T)</h2>
|
||||
<h2><a name="BOOST_PP_TUPLE_TO_LIST">#define BOOST_PP_TUPLE_TO_LIST</a>(SIZE_OF_TUPLE,TUPLE)</h2>
|
||||
<p>Converts a tuple to a list.</p>
|
||||
|
||||
<p>For example,</p>
|
||||
|
@ -26,23 +26,23 @@
|
||||
|
||||
<hr>
|
||||
|
||||
<h2><a name="BOOST_PP_WHILE">#define BOOST_PP_WHILE</a>(C,F,X)</h2>
|
||||
<p>Iterates <code>F(D,X)</code> while <code>C(D,X)</code> is true.</p>
|
||||
<h2><a name="BOOST_PP_WHILE">#define BOOST_PP_WHILE</a>(PRED,OP,STATE)</h2>
|
||||
<p>Iterates <code>OP(D,STATE)</code> while <code>PRED(D,STATE)</code> is true.</p>
|
||||
|
||||
<p>In other words, expands to:</p>
|
||||
|
||||
<pre>
|
||||
F(D, ... F(D, F(D,X) ) ... )
|
||||
OP(D, ... OP(D, OP(D,STATE) ) ... )
|
||||
</pre>
|
||||
|
||||
<p>The depth of iteration is determined by <code>C(D,X)</code>.</p>
|
||||
<p>The depth of iteration is determined by <code>PRED(D,STATE)</code>.</p>
|
||||
|
||||
<p>For example,</p>
|
||||
|
||||
<pre>
|
||||
#define C(D,X) <a href="comparison_less.htm#BOOST_PP_LESS_D">BOOST_PP_LESS_D</a>(D,<a href="tuple_elem.htm#BOOST_PP_TUPLE_ELEM">BOOST_PP_TUPLE_ELEM</a>(2,0,X),<a href="tuple_elem.htm#BOOST_PP_TUPLE_ELEM">BOOST_PP_TUPLE_ELEM</a>(2,1,X))
|
||||
#define F(D,X) (<a href="inc.htm#BOOST_PP_INC">BOOST_PP_INC</a>(<a href="tuple_elem.htm#BOOST_PP_TUPLE_ELEM">BOOST_PP_TUPLE_ELEM</a>(2,0,X)),<a href="tuple_elem.htm#BOOST_PP_TUPLE_ELEM">BOOST_PP_TUPLE_ELEM</a>(2,1,X))
|
||||
<a href="while.htm#BOOST_PP_WHILE">BOOST_PP_WHILE</a>(C,F,(0,3))
|
||||
#define PRED(D,STATE) <a href="comparison_less.htm#BOOST_PP_LESS_D">BOOST_PP_LESS_D</a>(D,<a href="tuple_elem.htm#BOOST_PP_TUPLE_ELEM">BOOST_PP_TUPLE_ELEM</a>(2,0,STATE),<a href="tuple_elem.htm#BOOST_PP_TUPLE_ELEM">BOOST_PP_TUPLE_ELEM</a>(2,1,STATE))
|
||||
#define OP(D,STATE) (<a href="inc.htm#BOOST_PP_INC">BOOST_PP_INC</a>(<a href="tuple_elem.htm#BOOST_PP_TUPLE_ELEM">BOOST_PP_TUPLE_ELEM</a>(2,0,STATE)),<a href="tuple_elem.htm#BOOST_PP_TUPLE_ELEM">BOOST_PP_TUPLE_ELEM</a>(2,1,STATE))
|
||||
<a href="while.htm#BOOST_PP_WHILE">BOOST_PP_WHILE</a>(PRED,OP,(0,3))
|
||||
</pre>
|
||||
|
||||
<p>expands to:</p>
|
||||
@ -53,11 +53,11 @@
|
||||
|
||||
<h3>Legend</h3>
|
||||
<ul>
|
||||
<li><b>X</b> is the current state of iteration. The state is usually a tuple.</li>
|
||||
<li><b>C</b> is the condition for iteration. It must expand to a decimal
|
||||
<li><b>STATE</b> is the current state of iteration. The state is usually a tuple.</li>
|
||||
<li><b>PRED</b> is the condition for iteration. It must expand to a decimal
|
||||
integer literal.</li>
|
||||
<li><b>F</b> is the iterated macro. Note that if the state is a tuple, then
|
||||
F(D,X) usually expands to a tuple of the same number of elements.</li>
|
||||
<li><b>OP</b> is the iterated macro. Note that if the state is a tuple, then
|
||||
OP(D,STATE) usually expands to a tuple of the same number of elements.</li>
|
||||
<li><b>D</b> is the recursion depth and should only be used as a parameter
|
||||
to other macros using <a href="while.htm#BOOST_PP_WHILE">BOOST_PP_WHILE</a>(). Such macros include
|
||||
<a href="arithmetic_add.htm#BOOST_PP_ADD">BOOST_PP_ADD</a>() and other arithmetic operations. For each macro using
|
||||
|
@ -16,12 +16,14 @@
|
||||
#include <boost/preprocessor/expr_if.hpp>
|
||||
#include <boost/preprocessor/logical/not.hpp>
|
||||
|
||||
/** <p>Expands to nothing if <code>C != 0</code> and to <code>MSG</code> if
|
||||
<code>C == 0</code>.</p>
|
||||
/** <p>Expands to nothing if <code>COND != 0</code> and to <code>MSG</code> if
|
||||
<code>COND == 0</code>.</p>
|
||||
|
||||
<p><code>COND</code> must expand to an integer literal.</p>
|
||||
|
||||
<p>For example, <code>BOOST_PP_ASSERT_MSG(1,A BUG!)</code> expands to <code>A BUG!</code>.</p>
|
||||
*/
|
||||
#define BOOST_PP_ASSERT_MSG(C,MSG) BOOST_PP_EXPR_IF(BOOST_PP_NOT(C),MSG)
|
||||
#define BOOST_PP_ASSERT_MSG(COND,MSG) BOOST_PP_EXPR_IF(BOOST_PP_NOT(COND),MSG)
|
||||
|
||||
/** <p>Obsolete. Use BOOST_PP_ASSERT_MSG().</p> */
|
||||
#define BOOST_PREPROCESSOR_ASSERT_MSG(C,MSG) BOOST_PP_ASSERT_MSG(C,MSG)
|
||||
|
@ -17,12 +17,14 @@
|
||||
#include <boost/preprocessor/empty.hpp>
|
||||
#include <boost/preprocessor/if.hpp>
|
||||
|
||||
/** <p>Expands to a comma if <code>C != 0</code> and nothing if
|
||||
<code>C == 0</code>.</p>
|
||||
/** <p>Expands to a comma if <code>COND != 0</code> and nothing if
|
||||
<code>COND == 0</code>.</p>
|
||||
|
||||
<p><code>COND</code> must expand to an integer literal.</p>
|
||||
|
||||
<p>For example, <code>BOOST_PP_COMMA_IF(0)</code> expands to nothing.</p>
|
||||
*/
|
||||
#define BOOST_PP_COMMA_IF(C) BOOST_PP_IF(C,BOOST_PP_COMMA,BOOST_PP_EMPTY)()
|
||||
#define BOOST_PP_COMMA_IF(COND) BOOST_PP_IF(COND,BOOST_PP_COMMA,BOOST_PP_EMPTY)()
|
||||
|
||||
/** <p>Obsolete. Use BOOST_PP_COMMA_IF().</p> */
|
||||
#define BOOST_PREPROCESSOR_COMMA_IF(C) BOOST_PP_COMMA_IF(C)
|
||||
|
@ -19,6 +19,8 @@
|
||||
/** <p>Expands to <code>1</code> if <code>X == Y</code> and <code>0</code>
|
||||
otherwise.</p>
|
||||
|
||||
<p>Both <code>X</code> and <code>Y</code> must expand to integer literals.</p>
|
||||
|
||||
<p>For example, <code>BOOST_PP_EQUAL(4,4)</code> expands to <code>1</code>.</p>
|
||||
|
||||
<h3>Uses</h3>
|
||||
|
@ -18,6 +18,8 @@
|
||||
/** <p>Expands to <code>1</code> if <code>X > Y</code> and <code>0</code>
|
||||
otherwise.</p>
|
||||
|
||||
<p>Both <code>X</code> and <code>Y</code> must expand to integer literals.</p>
|
||||
|
||||
<p>For example, <code>BOOST_PP_GREATER(4,3)</code> expands to <code>1</code>.</p>
|
||||
|
||||
<h3>Uses</h3>
|
||||
|
@ -18,6 +18,8 @@
|
||||
/** <p>Expands to <code>1</code> if <code>X >= Y</code> and <code>0</code>
|
||||
otherwise.</p>
|
||||
|
||||
<p>Both <code>X</code> and <code>Y</code> must expand to integer literals.</p>
|
||||
|
||||
<p>For example, <code>BOOST_PP_GREATER_EQUAL(1,3)</code> expands to <code>0</code>.</p>
|
||||
|
||||
<h3>Uses</h3>
|
||||
|
@ -20,6 +20,8 @@
|
||||
/** <p>Expands to <code>1</code> if <code>X < Y</code> and <code>0</code>
|
||||
otherwise.</p>
|
||||
|
||||
<p>Both <code>X</code> and <code>Y</code> must expand to integer literals.</p>
|
||||
|
||||
<p>For example, <code>BOOST_PP_LESS(2,6)</code> expands to <code>1</code>.</p>
|
||||
|
||||
<h3>Uses</h3>
|
||||
|
@ -19,6 +19,8 @@
|
||||
/** <p>Expands to <code>1</code> if <code>X <= Y</code> and <code>0</code>
|
||||
otherwise.</p>
|
||||
|
||||
<p><code>X</code> must expand to an integer literal.</p>
|
||||
|
||||
<p>For example, <code>BOOST_PP_LESS_EQUAL(7,5)</code> expands to <code>0</code>.</p>
|
||||
|
||||
<h3>Uses</h3>
|
||||
|
@ -20,6 +20,8 @@
|
||||
/** <p>Expands to <code>1</code> if <code>X != Y</code> and <code>0</code>
|
||||
otherwise.</p>
|
||||
|
||||
<p>Both <code>X</code> and <code>Y</code> must expand to integer literals.</p>
|
||||
|
||||
<p>For example, <code>BOOST_PP_NOT_EQUAL(4,4)</code> expands to <code>0</code>.</p>
|
||||
|
||||
<h3>Uses</h3>
|
||||
|
@ -22,14 +22,14 @@
|
||||
<p>In other words, expands to the sequence:</p>
|
||||
|
||||
<pre>
|
||||
F(0,P), F(1,P), ..., F(BOOST_PP_DEC(N),P)
|
||||
MACRO(0,DATA), MACRO(1,DATA), ..., MACRO(BOOST_PP_DEC(COUNT),DATA)
|
||||
</pre>
|
||||
|
||||
<p>For example,</p>
|
||||
|
||||
<pre>
|
||||
#define TYPED_PARAM(I,P)\
|
||||
BOOST_PP_CAT(BOOST_PP_TUPLE_ELEM(2,0,P),I) BOOST_PP_CAT(BOOST_PP_TUPLE_ELEM(2,1,P),I)
|
||||
#define TYPED_PARAM(INDEX,DATA)\
|
||||
BOOST_PP_CAT(BOOST_PP_TUPLE_ELEM(2,0,DATA),INDEX) BOOST_PP_CAT(BOOST_PP_TUPLE_ELEM(2,1,DATA),INDEX)
|
||||
BOOST_PP_ENUM(3,TYPED_PARAM,(X,x))
|
||||
</pre>
|
||||
|
||||
@ -49,7 +49,7 @@
|
||||
<li><a href="../../test/repeat_test.cpp">repeat_test.cpp</a></li>
|
||||
</ul>
|
||||
*/
|
||||
#define BOOST_PP_ENUM(N,F,P) BOOST_PP_REPEAT(N,BOOST_PP_ENUM_F,(F,P))
|
||||
#define BOOST_PP_ENUM(COUNT,MACRO,DATA) BOOST_PP_REPEAT(COUNT,BOOST_PP_ENUM_F,(MACRO,DATA))
|
||||
|
||||
#if !defined(BOOST_NO_COMPILER_CONFIG) && defined(__MWERKS__)
|
||||
# define BOOST_PP_ENUM_F(I,FP) BOOST_PP_COMMA_IF(I) BOOST_PP_TUPLE_ELEM(2,0,FP)(I,BOOST_PP_TUPLE_ELEM(2,1,FP))
|
||||
|
@ -21,7 +21,7 @@
|
||||
<p>In other words, expands to the sequence:</p>
|
||||
|
||||
<pre>
|
||||
BOOST_PP_CAT(P,0), BOOST_PP_CAT(P,1), ..., BOOST_PP_CAT(P,BOOST_PP_DEC(N))
|
||||
BOOST_PP_CAT(PARAM,0), BOOST_PP_CAT(PARAM,1), ..., BOOST_PP_CAT(PARAM,BOOST_PP_DEC(COUNT))
|
||||
</pre>
|
||||
|
||||
<p>For example,</p>
|
||||
@ -46,7 +46,7 @@
|
||||
<li><a href="../../test/repeat_test.cpp">repeat_test.cpp</a></li>
|
||||
</ul>
|
||||
*/
|
||||
#define BOOST_PP_ENUM_PARAMS(N,P) BOOST_PP_ENUM(N,BOOST_PP_ENUM_PARAMS_F,P)
|
||||
#define BOOST_PP_ENUM_PARAMS(COUNT,PARAM) BOOST_PP_ENUM(COUNT,BOOST_PP_ENUM_PARAMS_F,PARAM)
|
||||
|
||||
#define BOOST_PP_ENUM_PARAMS_F(I,P) BOOST_PP_CAT(P,I)
|
||||
|
||||
|
@ -21,7 +21,10 @@
|
||||
<p>In other words, expands to the sequence:</p>
|
||||
|
||||
<pre>
|
||||
BOOST_PP_CAT(P,0) = D, BOOST_PP_CAT(P,1) = D, ..., BOOST_PP_CAT(P,BOOST_PP_DEC(N)) = D
|
||||
BOOST_PP_CAT(PARAM,0) = DEFAULT,
|
||||
BOOST_PP_CAT(PARAM,1) = DEFAULT,
|
||||
...,
|
||||
BOOST_PP_CAT(PARAM,BOOST_PP_DEC(COUNT)) = DEFAULT
|
||||
</pre>
|
||||
|
||||
<p>For example,</p>
|
||||
@ -46,7 +49,7 @@
|
||||
<li><a href="../../test/repeat_test.cpp">repeat_test.cpp</a></li>
|
||||
</ul>
|
||||
*/
|
||||
#define BOOST_PP_ENUM_PARAMS_WITH_A_DEFAULT(N,P,D) BOOST_PP_ENUM(N,BOOST_PP_ENUM_PARAMS_WITH_A_DEFAULT_F,(P,D))
|
||||
#define BOOST_PP_ENUM_PARAMS_WITH_A_DEFAULT(COUNT,PARAM,DEFAULT) BOOST_PP_ENUM(COUNT,BOOST_PP_ENUM_PARAMS_WITH_A_DEFAULT_F,(PARAM,DEFAULT))
|
||||
|
||||
#if !defined(BOOST_NO_COMPILER_CONFIG) && defined(__MWERKS__)
|
||||
# define BOOST_PP_ENUM_PARAMS_WITH_A_DEFAULT_F(I,PD) BOOST_PP_CAT(BOOST_PP_TUPLE_ELEM(2,0,PD),I)=BOOST_PP_TUPLE_ELEM(2,1,PD)
|
||||
|
@ -21,10 +21,10 @@
|
||||
<p>In other words, expands to the sequence:</p>
|
||||
|
||||
<pre>
|
||||
BOOST_PP_CAT(P,0) = BOOST_PP_CAT(D,0),
|
||||
BOOST_PP_CAT(P,1) = BOOST_PP_CAT(D,1),
|
||||
BOOST_PP_CAT(PARAM,0) = BOOST_PP_CAT(DEFAULT,0),
|
||||
BOOST_PP_CAT(PARAM,1) = BOOST_PP_CAT(DEFAULT,1),
|
||||
...,
|
||||
BOOST_PP_CAT(P,BOOST_PP_DEC(N)) = BOOST_PP_CAT(D,BOOST_PP_DEC(N))
|
||||
BOOST_PP_CAT(PARAM,BOOST_PP_DEC(COUNT)) = BOOST_PP_CAT(DEFAULT,BOOST_PP_DEC(COUNT))
|
||||
</pre>
|
||||
|
||||
<p>For example,</p>
|
||||
@ -49,7 +49,7 @@
|
||||
<li><a href="../../test/repeat_test.cpp">repeat_test.cpp</a></li>
|
||||
</ul>
|
||||
*/
|
||||
#define BOOST_PP_ENUM_PARAMS_WITH_DEFAULTS(N,P,D) BOOST_PP_ENUM(N,BOOST_PP_ENUM_PARAMS_WITH_DEFAULTS_F,(P,D))
|
||||
#define BOOST_PP_ENUM_PARAMS_WITH_DEFAULTS(COUNT,PARAM,DEFAULT) BOOST_PP_ENUM(COUNT,BOOST_PP_ENUM_PARAMS_WITH_DEFAULTS_F,(PARAM,DEFAULT))
|
||||
|
||||
#if !defined(BOOST_NO_COMPILER_CONFIG) && defined(__MWERKS__)
|
||||
# define BOOST_PP_ENUM_PARAMS_WITH_DEFAULTS_F(I,PD) BOOST_PP_CAT(BOOST_PP_TUPLE_ELEM(2,0,PD),I)=BOOST_PP_CAT(BOOST_PP_TUPLE_ELEM(2,1,PD),I)
|
||||
|
@ -22,14 +22,14 @@
|
||||
<p>In other words, expands to the sequence:</p>
|
||||
|
||||
<pre>
|
||||
F(1,P), F(2,P), ..., F(BOOST_PP_DEC(N),P)
|
||||
MACRO(1,DATA), MACRO(2,DATA), ..., MACRO(BOOST_PP_DEC(COUNT),DATA)
|
||||
</pre>
|
||||
|
||||
<p>For example,</p>
|
||||
|
||||
<pre>
|
||||
#define TYPED_PARAM(I,P)\
|
||||
BOOST_PP_CAT(BOOST_PP_TUPLE_ELEM(2,0,P),I) BOOST_PP_CAT(BOOST_PP_TUPLE_ELEM(2,1,P),I)
|
||||
#define TYPED_PARAM(INDEX,DATA)\
|
||||
BOOST_PP_CAT(BOOST_PP_TUPLE_ELEM(2,0,DATA),INDEX) BOOST_PP_CAT(BOOST_PP_TUPLE_ELEM(2,1,DATA),INDEX)
|
||||
BOOST_PP_ENUM_SHIFTED(3,TYPED_PARAM,(X,x))
|
||||
</pre>
|
||||
|
||||
@ -44,7 +44,7 @@
|
||||
<li>BOOST_PP_REPEAT()</li>
|
||||
</ul>
|
||||
*/
|
||||
#define BOOST_PP_ENUM_SHIFTED(N,F,P) BOOST_PP_ENUM(BOOST_PP_DEC(N),BOOST_PP_ENUM_SHIFTED_F,(F,P))
|
||||
#define BOOST_PP_ENUM_SHIFTED(COUNT,MACRO,DATA) BOOST_PP_ENUM(BOOST_PP_DEC(COUNT),BOOST_PP_ENUM_SHIFTED_F,(MACRO,DATA))
|
||||
|
||||
#if !defined(BOOST_NO_COMPILER_CONFIG) && defined(__MWERKS__)
|
||||
# define BOOST_PP_ENUM_SHIFTED_F(I,FP) BOOST_PP_TUPLE_ELEM(2,0,FP)(BOOST_PP_INC(I),BOOST_PP_TUPLE_ELEM(2,1,FP))
|
||||
|
@ -21,7 +21,7 @@
|
||||
<p>In other words, expands to the sequence:</p>
|
||||
|
||||
<pre>
|
||||
BOOST_PP_CAT(P,1), BOOST_PP_CAT(P,2), ..., BOOST_PP_CAT(P,BOOST_PP_DEC(N))
|
||||
BOOST_PP_CAT(PARAM,1), BOOST_PP_CAT(PARAM,2), ..., BOOST_PP_CAT(PARAM,BOOST_PP_DEC(COUNT))
|
||||
</pre>
|
||||
<p>For example,</p>
|
||||
|
||||
@ -51,7 +51,7 @@
|
||||
<li><a href="../../test/repeat_2nd_test.cpp">repeat_2nd_test.cpp</a></li>
|
||||
</ul>
|
||||
*/
|
||||
#define BOOST_PP_ENUM_SHIFTED_PARAMS(N,P) BOOST_PP_ENUM_SHIFTED(N,BOOST_PP_ENUM_SHIFTED_PARAMS_F,P)
|
||||
#define BOOST_PP_ENUM_SHIFTED_PARAMS(COUNT,PARAM) BOOST_PP_ENUM_SHIFTED(COUNT,BOOST_PP_ENUM_SHIFTED_PARAMS_F,PARAM)
|
||||
|
||||
#define BOOST_PP_ENUM_SHIFTED_PARAMS_F(I,P) BOOST_PP_CAT(P,I)
|
||||
|
||||
|
@ -15,7 +15,9 @@
|
||||
|
||||
#include <boost/preprocessor/logical/bool.hpp>
|
||||
|
||||
/** <p>Expands to <code>E</code> if <code>C != 0</code> and to nothing if <code>C == 0</code>.</p>
|
||||
/** <p>Expands to <code>EXPR</code> if <code>COND != 0</code> and to nothing if <code>COND == 0</code>.</p>
|
||||
|
||||
<p><code>COND</code> must expand to an integer literal.</p>
|
||||
|
||||
<p>For example, <code>BOOST_PP_EXPR_IF(1,^)</code> expands to <code>^</code>.</p>
|
||||
|
||||
@ -24,7 +26,7 @@
|
||||
<li>BOOST_PP_IF()</li>
|
||||
</ul>
|
||||
*/
|
||||
#define BOOST_PP_EXPR_IF(C,E) BOOST_PP_EXPR_IF_BOOL(BOOST_PP_BOOL(C),E)
|
||||
#define BOOST_PP_EXPR_IF(COND,EXPR) BOOST_PP_EXPR_IF_BOOL(BOOST_PP_BOOL(COND),EXPR)
|
||||
|
||||
#define BOOST_PP_EXPR_IF_BOOL(C,E) BOOST_PP_EXPR_IF_BOOL_DELAY(C,E)
|
||||
#define BOOST_PP_EXPR_IF_BOOL_DELAY(C,E) BOOST_PP_EXPR_IF_BOOL##C(E)
|
||||
|
@ -16,24 +16,24 @@
|
||||
#include <boost/preprocessor/if.hpp>
|
||||
#include <boost/preprocessor/tuple/eat.hpp>
|
||||
|
||||
/** <p>Repeats <code>I(R,X)</code> and iterates <code>F(R,X)</code> while
|
||||
<code>C(R,X)</code> is true.</p>
|
||||
/** <p>Repeats <code>MACRO(R,STATE)</code> and iterates <code>OP(R,STATE)</code> while
|
||||
<code>PRED(R,STATE)</code> is true.</p>
|
||||
|
||||
<p>In other words, expands to the sequence:</p>
|
||||
|
||||
<pre>
|
||||
I(R,X) I(R,F(R,X)) I(R,F(R,F(R,X))) ... I(R,F(R,F(...F(R,X)...)))
|
||||
MACRO(R,STATE) MACRO(R,OP(R,STATE)) MACRO(R,OP(R,OP(R,STATE))) ... MACRO(R,OP(R,OP(...OP(R,STATE)...)))
|
||||
</pre>
|
||||
|
||||
<p>The length of the sequence is determined by <code>C(R,X)</code>.</p>
|
||||
<p>The length of the sequence is determined by <code>PRED(R,STATE)</code>.</p>
|
||||
|
||||
<p>For example,</p>
|
||||
|
||||
<pre>
|
||||
#define C(R,X) BOOST_PP_LESS(BOOST_PP_TUPLE_ELEM(2,0,X),BOOST_PP_TUPLE_ELEM(2,1,X))
|
||||
#define F(R,X) (BOOST_PP_INC(BOOST_PP_TUPLE_ELEM(2,0,X)),BOOST_PP_TUPLE_ELEM(2,1,X))
|
||||
#define I(R,X) BOOST_PP_TUPLE_ELEM(2,0,X)
|
||||
BOOST_PP_FOR((0,3),C,F,I)
|
||||
#define PRED(R,STATE) BOOST_PP_LESS(BOOST_PP_TUPLE_ELEM(2,0,STATE),BOOST_PP_TUPLE_ELEM(2,1,STATE))
|
||||
#define OP(R,STATE) (BOOST_PP_INC(BOOST_PP_TUPLE_ELEM(2,0,STATE)),BOOST_PP_TUPLE_ELEM(2,1,STATE))
|
||||
#define MACRO(R,STATE) BOOST_PP_TUPLE_ELEM(2,0,STATE)
|
||||
BOOST_PP_FOR((0,3),PRED,OP,MACRO)
|
||||
</pre>
|
||||
|
||||
<p>expands to:</p>
|
||||
@ -44,19 +44,19 @@
|
||||
|
||||
<h3>Legend</h3>
|
||||
<ul>
|
||||
<li><b>X</b> is the current state of iteration. The state is usually a tuple.</li>
|
||||
<li><b>C</b> is the condition for iteration. It must expand to a decimal
|
||||
<li><b>STATE</b> is the current state of iteration. The state is usually a tuple.</li>
|
||||
<li><b>PRED</b> is the condition for iteration. It must expand to a decimal
|
||||
integer literal.</li>
|
||||
<li><b>F</b> is the iterated macro. Note that if the state is a tuple, then
|
||||
F(R,X) usually expands to a tuple of the same number of elements.</li>
|
||||
<li><b>I</b> is the state instantiation macro.</li>
|
||||
<li><b>OP</b> is the iterated macro. Note that if the state is a tuple, then
|
||||
OP(R,STATE) usually expands to a tuple of the same number of elements.</li>
|
||||
<li><b>MACRO</b> is the state instantiation macro.</li>
|
||||
<li><b>R</b> is the recursion depth and should only be used as a parameter to
|
||||
other macros using BOOST_PP_FOR() or for invoking BOOST_PP_FOR##R()
|
||||
directly. For each macro using BOOST_PP_FOR(), there is a version of the
|
||||
macro, distinguished by the R suffix, that accepts an additional
|
||||
recursion depth as the first parameter. This technique is necessary to
|
||||
avoid recursively expanding the same macro again, which is not permitted
|
||||
by the C++ preprocessor.</li>
|
||||
directly. For each macro using BOOST_PP_FOR(), e.g. BOOST_PP_LIST_FOR_EACH(),
|
||||
there is a version of the macro, e.g. BOOST_PP_LIST_FOR_EACH_R(), distinguished
|
||||
by the R suffix, that accepts an additional recursion depth as the first
|
||||
parameter. This technique is necessary to avoid recursively expanding the same
|
||||
macro again, which is not permitted by the C++ preprocessor.</li>
|
||||
</ul>
|
||||
|
||||
<h3>BOOST_PP_REPEAT() vs BOOST_PP_FOR()</h3>
|
||||
@ -76,7 +76,7 @@ invoking BOOST_PP_FOR##R() directly.</p>
|
||||
<li><a href="../../test/for_test.cpp">for_test.cpp</a></li>
|
||||
</ul>
|
||||
*/
|
||||
#define BOOST_PP_FOR(X,C,F,I) BOOST_PP_FOR0(X,C,F,I)
|
||||
#define BOOST_PP_FOR(STATE,PRED,OP,MACRO) BOOST_PP_FOR0(STATE,PRED,OP,MACRO)
|
||||
|
||||
#define BOOST_PP_FOR_C0(C,R,X,I) BOOST_PP_IF(C(R,X),I,BOOST_PP_TUPLE2_EAT)
|
||||
#define BOOST_PP_FOR_C1(C,R,X) BOOST_PP_IF(C(R,X),BOOST_PP_FOR##R,BOOST_PP_TUPLE4_EAT)
|
||||
|
@ -16,8 +16,10 @@
|
||||
#include <boost/preprocessor/logical/bool.hpp>
|
||||
#include <boost/preprocessor/tuple/elem.hpp>
|
||||
|
||||
/** <p>Expands to <code>T</code> if <code>C != 0</code> and <code>E</code> if
|
||||
<code>C == 0</code>.</p>
|
||||
/** <p>Expands to <code>THEN</code> if <code>COND != 0</code> and <code>ELSE</code> if
|
||||
<code>COND == 0</code>.</p>
|
||||
|
||||
<p><code>COND</code> must expand to an integer literal.</p>
|
||||
|
||||
<p>For example, <code>BOOST_PP_IF(0,1,2)</code> expands to <code>2</code>.</p>
|
||||
|
||||
@ -31,7 +33,7 @@
|
||||
<li><a href="../../test/preprocessor_test.cpp">preprocessor_test.cpp</a></li>
|
||||
</ul>
|
||||
*/
|
||||
#define BOOST_PP_IF(C,T,E) BOOST_PP_IF_BOOL(BOOST_PP_BOOL(C))(E,T)
|
||||
#define BOOST_PP_IF(COND,THEN,ELSE) BOOST_PP_IF_BOOL(BOOST_PP_BOOL(COND))(ELSE,THEN)
|
||||
|
||||
#define BOOST_PP_IF_BOOL(C) BOOST_PP_IF_BOOL_DELAY(C)
|
||||
#define BOOST_PP_IF_BOOL_DELAY(C) BOOST_PP_TUPLE2_ELEM##C
|
||||
|
@ -39,7 +39,7 @@ and BOOST_PP_REPEAT family).</p>
|
||||
*/
|
||||
#define BOOST_PP_LIMIT_MAG 128
|
||||
|
||||
/** <p>Expands to the maximum tuple length supported by the library.</p> */
|
||||
/** <p>Expands to the maximum tuple size supported by the library.</p> */
|
||||
#define BOOST_PP_LIMIT_TUPLE 16
|
||||
|
||||
/** <p>Obsolete. Use BOOST_PP_LIMIT_DIM.</p> */
|
||||
|
@ -64,23 +64,23 @@ and BOOST_PP_LIST_FOLD_RIGHT_2ND():</p>
|
||||
)
|
||||
</pre>
|
||||
*/
|
||||
#define BOOST_PP_LIST_CONS(H,T) (H,T,1)
|
||||
#define BOOST_PP_LIST_CONS(FIRST,REST) (FIRST,REST,1)
|
||||
|
||||
/** <p>List nil constructor.</p> */
|
||||
#define BOOST_PP_LIST_NIL (_,_,0)
|
||||
|
||||
/** <p>Expands to 1 if the list is not nil and 0 otherwise.</p> */
|
||||
#if !defined(BOOST_NO_COMPILER_CONFIG) && defined(__MWERKS__)
|
||||
# define BOOST_PP_LIST_IS_CONS(L) BOOST_PP_TUPLE_ELEM(3,2,L)
|
||||
# define BOOST_PP_LIST_IS_CONS(LIST) BOOST_PP_TUPLE_ELEM(3,2,LIST)
|
||||
#else
|
||||
# define BOOST_PP_LIST_IS_CONS(L) BOOST_PP_TUPLE3_ELEM2 L
|
||||
# define BOOST_PP_LIST_IS_CONS(LIST) BOOST_PP_TUPLE3_ELEM2 LIST
|
||||
#endif
|
||||
|
||||
/** <p>Expands to 1 if the list is nil and 0 otherwise.</p> */
|
||||
#if !defined(BOOST_NO_COMPILER_CONFIG) && defined(__MWERKS__)
|
||||
# define BOOST_PP_LIST_IS_NIL(L) BOOST_PP_NOT(BOOST_PP_TUPLE_ELEM(3,2,L))
|
||||
# define BOOST_PP_LIST_IS_NIL(LIST) BOOST_PP_NOT(BOOST_PP_TUPLE_ELEM(3,2,LIST))
|
||||
#else
|
||||
# define BOOST_PP_LIST_IS_NIL(L) BOOST_PP_NOT(BOOST_PP_TUPLE3_ELEM2 L)
|
||||
# define BOOST_PP_LIST_IS_NIL(LIST) BOOST_PP_NOT(BOOST_PP_TUPLE3_ELEM2 LIST)
|
||||
#endif
|
||||
|
||||
/** <p>Expands to the first element of the list. The list must not be nil.</p>
|
||||
@ -94,9 +94,9 @@ and BOOST_PP_LIST_FOLD_RIGHT_2ND():</p>
|
||||
<p>expands to 1.</p>
|
||||
*/
|
||||
#if !defined(BOOST_NO_COMPILER_CONFIG) && defined(__MWERKS__)
|
||||
# define BOOST_PP_LIST_FIRST(L) BOOST_PP_TUPLE_ELEM(3,0,L)
|
||||
# define BOOST_PP_LIST_FIRST(LIST) BOOST_PP_TUPLE_ELEM(3,0,LIST)
|
||||
#else
|
||||
# define BOOST_PP_LIST_FIRST(L) BOOST_PP_TUPLE3_ELEM0 L
|
||||
# define BOOST_PP_LIST_FIRST(LIST) BOOST_PP_TUPLE3_ELEM0 LIST
|
||||
#endif
|
||||
|
||||
/** <p>Expands to a list of all but the first element of the list.</p>
|
||||
@ -116,8 +116,8 @@ and BOOST_PP_LIST_FOLD_RIGHT_2ND():</p>
|
||||
</pre>
|
||||
*/
|
||||
#if !defined(BOOST_NO_COMPILER_CONFIG) && defined(__MWERKS__)
|
||||
# define BOOST_PP_LIST_REST(L) BOOST_PP_TUPLE_ELEM(3,1,L)
|
||||
# define BOOST_PP_LIST_REST(LIST) BOOST_PP_TUPLE_ELEM(3,1,LIST)
|
||||
#else
|
||||
# define BOOST_PP_LIST_REST(L) BOOST_PP_TUPLE3_ELEM1 L
|
||||
# define BOOST_PP_LIST_REST(LIST) BOOST_PP_TUPLE3_ELEM1 LIST
|
||||
#endif
|
||||
#endif
|
||||
|
@ -42,9 +42,9 @@
|
||||
<li><a href="../../test/list_test.cpp">list_test.cpp</a></li>
|
||||
</ul>
|
||||
*/
|
||||
#define BOOST_PP_LIST_APPEND(L,R) BOOST_PP_LIST_APPEND_D(0,L,R)
|
||||
#define BOOST_PP_LIST_APPEND(LIST_1ST,LIST_2ND) BOOST_PP_LIST_APPEND_D(0,LIST_1ST,LIST_2ND)
|
||||
|
||||
/** <p>Can be used inside BOOST_PP_WHILE().</p> */
|
||||
#define BOOST_PP_LIST_APPEND_D(D,L,R) BOOST_PP_LIST_FOLD_RIGHT_D(D,BOOST_PP_LIST_APPEND_F,L,R)
|
||||
#define BOOST_PP_LIST_APPEND_D(D,LIST_1ST,LIST_2ND) BOOST_PP_LIST_FOLD_RIGHT_D(D,BOOST_PP_LIST_APPEND_F,LIST_1ST,LIST_2ND)
|
||||
#define BOOST_PP_LIST_APPEND_F(D,H,P) (H,P,1)
|
||||
#endif
|
||||
|
@ -15,7 +15,7 @@
|
||||
|
||||
#include <boost/preprocessor/list/rest_n.hpp>
|
||||
|
||||
/** <p>Expands to the <code>I</code>:th element of the list <code>L</code>. The
|
||||
/** <p>Expands to the <code>INDEX</code>:th element of the list <code>LIST</code>. The
|
||||
first element is at index <code>0</code>.</p>
|
||||
|
||||
<p>For example,</p>
|
||||
@ -36,8 +36,8 @@ first element is at index <code>0</code>.</p>
|
||||
<li><a href="../../test/list_test.cpp">list_test.cpp</a></li>
|
||||
</ul>
|
||||
*/
|
||||
#define BOOST_PP_LIST_AT(L,I) BOOST_PP_LIST_AT_D(0,L,I)
|
||||
#define BOOST_PP_LIST_AT(LIST,INDEX) BOOST_PP_LIST_AT_D(0,LIST,INDEX)
|
||||
|
||||
/** <p>Can be used inside BOOST_PP_WHILE().</p> */
|
||||
#define BOOST_PP_LIST_AT_D(D,L,I) BOOST_PP_LIST_FIRST(BOOST_PP_LIST_REST_N_D(D,I,L))
|
||||
#define BOOST_PP_LIST_AT_D(D,LIST,INDEX) BOOST_PP_LIST_FIRST(BOOST_PP_LIST_REST_N_D(D,INDEX,LIST))
|
||||
#endif
|
||||
|
@ -40,9 +40,9 @@
|
||||
<li><a href="../../test/list_test.cpp">list_test.cpp</a></li>
|
||||
</ul>
|
||||
*/
|
||||
#define BOOST_PP_LIST_CAT(L) BOOST_PP_LIST_CAT_D(0,L)
|
||||
#define BOOST_PP_LIST_CAT(LIST) BOOST_PP_LIST_CAT_D(0,LIST)
|
||||
|
||||
/** <p>Can be used inside BOOST_PP_WHILE().</p> */
|
||||
#define BOOST_PP_LIST_CAT_D(D,L) BOOST_PP_LIST_FOLD_LEFT_D(D,BOOST_PP_LIST_CAT_F,BOOST_PP_TUPLE3_ELEM0 L,BOOST_PP_TUPLE3_ELEM1 L)
|
||||
#define BOOST_PP_LIST_CAT_D(D,LIST) BOOST_PP_LIST_FOLD_LEFT_D(D,BOOST_PP_LIST_CAT_F,BOOST_PP_TUPLE3_ELEM0 LIST,BOOST_PP_TUPLE3_ELEM1 LIST)
|
||||
#define BOOST_PP_LIST_CAT_F(D,P,H) BOOST_PP_CAT(P,H)
|
||||
#endif
|
||||
|
@ -35,9 +35,9 @@
|
||||
<li>BOOST_PP_LIST_FOR_EACH_I()</li>
|
||||
</ul>
|
||||
*/
|
||||
#define BOOST_PP_LIST_ENUM(L) BOOST_PP_LIST_ENUM_R(0,L)
|
||||
#define BOOST_PP_LIST_ENUM(LIST) BOOST_PP_LIST_ENUM_R(0,LIST)
|
||||
|
||||
/** <p>Can be used inside BOOST_PP_FOR().</p> */
|
||||
#define BOOST_PP_LIST_ENUM_R(R,L) BOOST_PP_LIST_FOR_EACH_I_R(R,BOOST_PP_LIST_ENUM_F,_,L)
|
||||
#define BOOST_PP_LIST_ENUM_R(R,LIST) BOOST_PP_LIST_FOR_EACH_I_R(R,BOOST_PP_LIST_ENUM_F,_,LIST)
|
||||
#define BOOST_PP_LIST_ENUM_F(R,_,I,X) BOOST_PP_COMMA_IF(I) X
|
||||
#endif
|
||||
|
@ -16,7 +16,7 @@
|
||||
#include <boost/preprocessor/list/fold_right.hpp>
|
||||
|
||||
/** <p>Expands to a list containing all the elements <code>X</code> of the list
|
||||
for which <code>F(D,P,X)</code> is true.</p>
|
||||
for which <code>PRED(D,DATA,X)</code> is true.</p>
|
||||
|
||||
<p>For example,</p>
|
||||
|
||||
@ -41,10 +41,10 @@ for which <code>F(D,P,X)</code> is true.</p>
|
||||
<li><a href="../../test/list_test.cpp">list_test.cpp</a></li>
|
||||
</ul>
|
||||
*/
|
||||
#define BOOST_PP_LIST_FILTER(F,P,L) BOOST_PP_LIST_FILTER_D(0,F,P,L)
|
||||
#define BOOST_PP_LIST_FILTER(PRED,DATA,LIST) BOOST_PP_LIST_FILTER_D(0,PRED,DATA,LIST)
|
||||
|
||||
/** <p>Can be used inside BOOST_PP_WHILE().</p> */
|
||||
#define BOOST_PP_LIST_FILTER_D(D,F,P,L) BOOST_PP_TUPLE_ELEM(3,2,BOOST_PP_LIST_FOLD_RIGHT_D(D,BOOST_PP_LIST_FILTER_F,L,(F,P,(_,_,0))))
|
||||
#define BOOST_PP_LIST_FILTER_D(D,PRED,DATA,LIST) BOOST_PP_TUPLE_ELEM(3,2,BOOST_PP_LIST_FOLD_RIGHT_D(D,BOOST_PP_LIST_FILTER_F,LIST,(PRED,DATA,(_,_,0))))
|
||||
#if !defined(BOOST_NO_COMPILER_CONFIG) && defined(__MWERKS__)
|
||||
# define BOOST_PP_LIST_FILTER_F(D,H,P) (BOOST_PP_TUPLE_ELEM(3,0,P),BOOST_PP_TUPLE_ELEM(3,1,P),BOOST_PP_IF(BOOST_PP_TUPLE_ELEM(3,0,P)(D,BOOST_PP_TUPLE3_ELEM1 P,H),BOOST_PP_LIST_CONS,BOOST_PP_TUPLE2_ELEM1)(H,BOOST_PP_TUPLE_ELEM(3,2,P)))
|
||||
#elif !defined(BOOST_NO_COMPILER_CONFIG) && defined(_MSC_VER)
|
||||
|
@ -17,8 +17,8 @@
|
||||
#include <boost/preprocessor/list/adt.hpp>
|
||||
#include <boost/preprocessor/while.hpp>
|
||||
|
||||
/** <p>Expands to a list of the first <code>N</code> elements of the list
|
||||
<code>L</code>.</p>
|
||||
/** <p>Expands to a list of the first <code>COUNT</code> elements of the list
|
||||
<code>LIST</code>.</p>
|
||||
|
||||
<p>For example,</p>
|
||||
|
||||
@ -47,10 +47,10 @@
|
||||
<li><a href="../../test/list_test.cpp">list_test.cpp</a></li>
|
||||
</ul>
|
||||
*/
|
||||
#define BOOST_PP_LIST_FIRST_N(N,L) BOOST_PP_LIST_FIRST_N_D(0,N,L)
|
||||
#define BOOST_PP_LIST_FIRST_N(COUNT,LIST) BOOST_PP_LIST_FIRST_N_D(0,COUNT,LIST)
|
||||
|
||||
/** <p>Can be used inside BOOST_PP_WHILE().</p> */
|
||||
#define BOOST_PP_LIST_FIRST_N_D(D,N,L) BOOST_PP_LIST_REVERSE_D(D,BOOST_PP_TUPLE_ELEM(3,0,BOOST_PP_WHILE##D(BOOST_PP_LIST_FIRST_N_C,BOOST_PP_LIST_FIRST_N_F,((_,_,0),L,N))))
|
||||
#define BOOST_PP_LIST_FIRST_N_D(D,COUNT,LIST) BOOST_PP_LIST_REVERSE_D(D,BOOST_PP_TUPLE_ELEM(3,0,BOOST_PP_WHILE##D(BOOST_PP_LIST_FIRST_N_C,BOOST_PP_LIST_FIRST_N_F,((_,_,0),LIST,COUNT))))
|
||||
#if !defined(BOOST_NO_COMPILER_CONFIG) && defined(__MWERKS__)
|
||||
# define BOOST_PP_LIST_FIRST_N_C(D,X) BOOST_PP_TUPLE_ELEM(3,2,X)
|
||||
# define BOOST_PP_LIST_FIRST_N_F(D,X) ((BOOST_PP_TUPLE_ELEM(3,0,BOOST_PP_TUPLE_ELEM(3,1,X)),BOOST_PP_TUPLE_ELEM(3,0,X),1),BOOST_PP_TUPLE_ELEM(3,1,BOOST_PP_TUPLE_ELEM(3,1,X)),BOOST_PP_DEC(BOOST_PP_TUPLE_ELEM(3,2,X)))
|
||||
|
@ -16,23 +16,23 @@
|
||||
#include <boost/preprocessor/list/adt.hpp>
|
||||
#include <boost/preprocessor/while.hpp>
|
||||
|
||||
/** <p>Iterates <code>F(D,P,X)</code> for each element <code>X</code> of the
|
||||
list <code>L</code> (from the left or the start of the list).</p>
|
||||
/** <p>Iterates <code>OP(D,STATE,X)</code> for each element <code>X</code> of the
|
||||
list <code>LIST</code> (from the left or the start of the list).</p>
|
||||
|
||||
<p>In other words, expands to:</p>
|
||||
|
||||
<pre>
|
||||
F
|
||||
OP
|
||||
( D
|
||||
, ... F(D, F(D,P,BOOST_PP_LIST_AT(L,0)), BOOST_PP_LIST_AT(L,1)) ...
|
||||
, BOOST_PP_LIST_AT(L,BOOST_PP_DEC(BOOST_PP_LIST_SIZE(L))
|
||||
, ... OP(D, OP(D,STATE,BOOST_PP_LIST_AT(LIST,0)), BOOST_PP_LIST_AT(LIST,1)) ...
|
||||
, BOOST_PP_LIST_AT(LIST,BOOST_PP_DEC(BOOST_PP_LIST_SIZE(LIST))
|
||||
)
|
||||
</pre>
|
||||
|
||||
<p>For example,</p>
|
||||
|
||||
<pre>
|
||||
#define TEST(D,P,X) BOOST_PP_CAT(P,X)
|
||||
#define TEST(D,STATE,X) BOOST_PP_CAT(STATE,X)
|
||||
BOOST_PP_LIST_FOLD_LEFT(TEST,_,BOOST_PP_TUPLE_TO_LIST(3,(A,B,C)))
|
||||
</pre>
|
||||
|
||||
@ -63,10 +63,10 @@ list <code>L</code> (from the left or the start of the list).</p>
|
||||
<li><a href="../../test/list_test.cpp">list_test.cpp</a></li>
|
||||
</ul>
|
||||
*/
|
||||
#define BOOST_PP_LIST_FOLD_LEFT(F,P,L) BOOST_PP_LIST_FOLD_LEFT_D(0,F,P,L)
|
||||
#define BOOST_PP_LIST_FOLD_LEFT(OP,STATE,LIST) BOOST_PP_LIST_FOLD_LEFT_D(0,OP,STATE,LIST)
|
||||
|
||||
/** <p>Can be used inside BOOST_PP_WHILE().</p> */
|
||||
#define BOOST_PP_LIST_FOLD_LEFT_D(D,F,P,L) BOOST_PP_TUPLE_ELEM(3,1,BOOST_PP_WHILE##D(BOOST_PP_LIST_FOLD_LEFT_C,BOOST_PP_LIST_FOLD_LEFT_F,(F,P,L)))
|
||||
#define BOOST_PP_LIST_FOLD_LEFT_D(D,OP,STATE,LIST) BOOST_PP_TUPLE_ELEM(3,1,BOOST_PP_WHILE##D(BOOST_PP_LIST_FOLD_LEFT_C,BOOST_PP_LIST_FOLD_LEFT_F,(OP,STATE,LIST)))
|
||||
#if !defined(BOOST_NO_COMPILER_CONFIG) && defined(__MWERKS__)
|
||||
# define BOOST_PP_LIST_FOLD_LEFT_C(D,X) BOOST_PP_TUPLE_ELEM(3,2,BOOST_PP_TUPLE_ELEM(3,2,X))
|
||||
# define BOOST_PP_LIST_FOLD_LEFT_F(D,X) (BOOST_PP_TUPLE_ELEM(3,0,X),BOOST_PP_TUPLE_ELEM(3,0,X)(D,BOOST_PP_TUPLE_ELEM(3,1,X),BOOST_PP_TUPLE_ELEM(3,0,BOOST_PP_TUPLE_ELEM(3,2,X))),BOOST_PP_TUPLE_ELEM(3,1,BOOST_PP_TUPLE_ELEM(3,2,X)))
|
||||
|
@ -17,10 +17,10 @@
|
||||
#include <boost/preprocessor/while.hpp>
|
||||
|
||||
/** <p>Same as BOOST_PP_LIST_FOLD_LEFT(), but implemented independently.</p> */
|
||||
#define BOOST_PP_LIST_FOLD_LEFT_2ND(F,P,L) BOOST_PP_LIST_FOLD_LEFT_2ND_D(0,F,P,L)
|
||||
#define BOOST_PP_LIST_FOLD_LEFT_2ND(OP,STATE,LIST) BOOST_PP_LIST_FOLD_LEFT_2ND_D(0,OP,STATE,LIST)
|
||||
|
||||
/** <p>Can be used inside BOOST_PP_WHILE().</p> */
|
||||
#define BOOST_PP_LIST_FOLD_LEFT_2ND_D(D,F,P,L) BOOST_PP_TUPLE_ELEM(3,1,BOOST_PP_WHILE##D(BOOST_PP_LIST_FOLD_LEFT_2ND_C,BOOST_PP_LIST_FOLD_LEFT_2ND_F,(F,P,L)))
|
||||
#define BOOST_PP_LIST_FOLD_LEFT_2ND_D(D,OP,STATE,LIST) BOOST_PP_TUPLE_ELEM(3,1,BOOST_PP_WHILE##D(BOOST_PP_LIST_FOLD_LEFT_2ND_C,BOOST_PP_LIST_FOLD_LEFT_2ND_F,(OP,STATE,LIST)))
|
||||
#if !defined(BOOST_NO_COMPILER_CONFIG) && defined(__MWERKS__)
|
||||
# define BOOST_PP_LIST_FOLD_LEFT_2ND_C(D,X) BOOST_PP_TUPLE_ELEM(3,2,BOOST_PP_TUPLE_ELEM(3,2,X))
|
||||
# define BOOST_PP_LIST_FOLD_LEFT_2ND_F(D,X) (BOOST_PP_TUPLE_ELEM(3,0,X),BOOST_PP_TUPLE_ELEM(3,0,X)(D,BOOST_PP_TUPLE_ELEM(3,1,X),BOOST_PP_TUPLE_ELEM(3,0,BOOST_PP_TUPLE_ELEM(3,2,X))),BOOST_PP_TUPLE_ELEM(3,1,BOOST_PP_TUPLE_ELEM(3,2,X)))
|
||||
|
@ -15,22 +15,22 @@
|
||||
|
||||
#include <boost/preprocessor/list/reverse.hpp>
|
||||
|
||||
/** <p>Iterates <code>F(D,X,P)</code> for each element <code>X</code> of the
|
||||
list <code>L</code> (from the right or the end of the list).</p>
|
||||
/** <p>Iterates <code>OP(D,X,STATE)</code> for each element <code>X</code> of the
|
||||
list <code>LIST</code> (from the right or the end of the list).</p>
|
||||
|
||||
<p>In other words, expands to:</p>
|
||||
|
||||
<pre>
|
||||
F
|
||||
OP
|
||||
( D
|
||||
, BOOST_PP_LIST_AT(L,0)
|
||||
, ... F
|
||||
, BOOST_PP_LIST_AT(LIST,0)
|
||||
, ... OP
|
||||
( D
|
||||
, BOOST_PP_LIST_AT(L,BOOST_PP_SUB(BOOST_PP_LIST_SIZE(L),2))
|
||||
, F
|
||||
, BOOST_PP_LIST_AT(LIST,BOOST_PP_SUB(BOOST_PP_LIST_SIZE(LIST),2))
|
||||
, OP
|
||||
( D
|
||||
, BOOST_PP_LIST_AT(L,BOOST_PP_SUB(BOOST_PP_LIST_SIZE(L),1))
|
||||
, P
|
||||
, BOOST_PP_LIST_AT(LIST,BOOST_PP_SUB(BOOST_PP_LIST_SIZE(LIST),1))
|
||||
, STATE
|
||||
)
|
||||
) ...
|
||||
)
|
||||
@ -39,7 +39,7 @@ list <code>L</code> (from the right or the end of the list).</p>
|
||||
<p>For example,</p>
|
||||
|
||||
<pre>
|
||||
#define TEST(D,X,P) BOOST_PP_CAT(P,X)
|
||||
#define TEST(D,X,STATE) BOOST_PP_CAT(STATE,X)
|
||||
BOOST_PP_LIST_FOLD_RIGHT(TEST,_,BOOST_PP_TUPLE_TO_LIST(3,(A,B,C)))
|
||||
</pre>
|
||||
|
||||
@ -60,10 +60,10 @@ list <code>L</code> (from the right or the end of the list).</p>
|
||||
<li><a href="../../test/list_test.cpp">list_test.cpp</a></li>
|
||||
</ul>
|
||||
*/
|
||||
#define BOOST_PP_LIST_FOLD_RIGHT(F,L,P) BOOST_PP_LIST_FOLD_RIGHT_D(0,F,L,P)
|
||||
#define BOOST_PP_LIST_FOLD_RIGHT(OP,LIST,STATE) BOOST_PP_LIST_FOLD_RIGHT_D(0,OP,LIST,STATE)
|
||||
|
||||
/** <p>Can be used inside BOOST_PP_WHILE().</p> */
|
||||
#define BOOST_PP_LIST_FOLD_RIGHT_D(D,F,L,P) BOOST_PP_TUPLE_ELEM(2,1,BOOST_PP_LIST_FOLD_LEFT_D(D,BOOST_PP_LIST_FOLD_RIGHT_F,(F,P),BOOST_PP_LIST_REVERSE_D(D,L)))
|
||||
#define BOOST_PP_LIST_FOLD_RIGHT_D(D,OP,LIST,STATE) BOOST_PP_TUPLE_ELEM(2,1,BOOST_PP_LIST_FOLD_LEFT_D(D,BOOST_PP_LIST_FOLD_RIGHT_F,(OP,STATE),BOOST_PP_LIST_REVERSE_D(D,LIST)))
|
||||
#if !defined(BOOST_NO_COMPILER_CONFIG) && defined(__MWERKS__)
|
||||
# define BOOST_PP_LIST_FOLD_RIGHT_F(D,P,H) (BOOST_PP_TUPLE_ELEM(2,0,P),BOOST_PP_TUPLE_ELEM(2,0,P)(D,H,BOOST_PP_TUPLE_ELEM(2,1,P)))
|
||||
#elif !defined(BOOST_NO_COMPILER_CONFIG) && defined(_MSC_VER)
|
||||
|
@ -17,10 +17,10 @@
|
||||
#include <boost/preprocessor/list/reverse.hpp>
|
||||
|
||||
/** <p>Same as BOOST_PP_LIST_FOLD_RIGHT(), but implemented independently.</p> */
|
||||
#define BOOST_PP_LIST_FOLD_RIGHT_2ND(F,L,P) BOOST_PP_LIST_FOLD_RIGHT_2ND_D(0,F,L,P)
|
||||
#define BOOST_PP_LIST_FOLD_RIGHT_2ND(OP,LIST,STATE) BOOST_PP_LIST_FOLD_RIGHT_2ND_D(0,OP,LIST,STATE)
|
||||
|
||||
/** <p>Can be used inside BOOST_PP_WHILE().</p> */
|
||||
#define BOOST_PP_LIST_FOLD_RIGHT_2ND_D(D,F,L,P) BOOST_PP_TUPLE_ELEM(2,1,BOOST_PP_LIST_FOLD_LEFT_2ND_D(D,BOOST_PP_LIST_FOLD_RIGHT_2ND_F,(F,P),BOOST_PP_LIST_FOLD_LEFT_2ND_D(D,BOOST_PP_LIST_REVERSE_F,(_,_,0),L)))
|
||||
#define BOOST_PP_LIST_FOLD_RIGHT_2ND_D(D,OP,LIST,STATE) BOOST_PP_TUPLE_ELEM(2,1,BOOST_PP_LIST_FOLD_LEFT_2ND_D(D,BOOST_PP_LIST_FOLD_RIGHT_2ND_F,(OP,STATE),BOOST_PP_LIST_FOLD_LEFT_2ND_D(D,BOOST_PP_LIST_REVERSE_F,(_,_,0),LIST)))
|
||||
#if !defined(BOOST_NO_COMPILER_CONFIG) && defined(__MWERKS__)
|
||||
# define BOOST_PP_LIST_FOLD_RIGHT_2ND_F(D,P,H) (BOOST_PP_TUPLE_ELEM(2,0,P),BOOST_PP_TUPLE_ELEM(2,0,P)(D,H,BOOST_PP_TUPLE_ELEM(2,1,P)))
|
||||
#elif !defined(BOOST_NO_COMPILER_CONFIG) && defined(_MSC_VER)
|
||||
|
@ -15,22 +15,22 @@
|
||||
|
||||
#include <boost/preprocessor/list/for_each_i.hpp>
|
||||
|
||||
/** <p>Repeats <code>F(R,P,BOOST_PP_LIST_AT(L,I))</code> for each I = [0,
|
||||
BOOST_PP_LIST_SIZE(L)[.</p>
|
||||
/** <p>Repeats <code>MACRO(R,DATA,BOOST_PP_LIST_AT(LIST,INDEX))</code> for each INDEX = [0,
|
||||
BOOST_PP_LIST_SIZE(LIST)[.</p>
|
||||
|
||||
<p>In other words, expands to the sequence:</p>
|
||||
|
||||
<pre>
|
||||
F(R,P,BOOST_PP_LIST_AT(L,0))
|
||||
F(R,P,BOOST_PP_LIST_AT(L,1))
|
||||
MACRO(R,DATA,BOOST_PP_LIST_AT(LIST,0))
|
||||
MACRO(R,DATA,BOOST_PP_LIST_AT(LIST,1))
|
||||
...
|
||||
F(R,P,BOOST_PP_LIST_AT(L,BOOST_PP_DEC(BOOST_PP_LIST_SIZE(L))))
|
||||
MACRO(R,DATA,BOOST_PP_LIST_AT(LIST,BOOST_PP_DEC(BOOST_PP_LIST_SIZE(LIST))))
|
||||
</pre>
|
||||
|
||||
<p>For example,</p>
|
||||
|
||||
<pre>
|
||||
#define TEST(R,P,X) BOOST_PP_CAT(P,X)();
|
||||
#define TEST(R,DATA,X) BOOST_PP_CAT(DATA,X)();
|
||||
BOOST_PP_LIST_FOR_EACH(TEST,prefix_,BOOST_PP_TUPLE_TO_LIST(3,(A,B,C)))
|
||||
</pre>
|
||||
|
||||
@ -56,9 +56,9 @@ BOOST_PP_LIST_SIZE(L)[.</p>
|
||||
<li><a href="../../test/list_test.cpp">list_test.cpp</a></li>
|
||||
</ul>
|
||||
*/
|
||||
#define BOOST_PP_LIST_FOR_EACH(F,P,L) BOOST_PP_LIST_FOR_EACH_R(0,F,P,L)
|
||||
#define BOOST_PP_LIST_FOR_EACH(MACRO,DATA,LIST) BOOST_PP_LIST_FOR_EACH_R(0,MACRO,DATA,LIST)
|
||||
|
||||
/** <p>Can be used inside BOOST_PP_FOR().</p> */
|
||||
#define BOOST_PP_LIST_FOR_EACH_R(R,F,P,L) BOOST_PP_LIST_FOR_EACH_I_R(R,BOOST_PP_LIST_FOR_EACH_F,(F,P),L)
|
||||
#define BOOST_PP_LIST_FOR_EACH_R(R,MACRO,DATA,LIST) BOOST_PP_LIST_FOR_EACH_I_R(R,BOOST_PP_LIST_FOR_EACH_F,(MACRO,DATA),LIST)
|
||||
#define BOOST_PP_LIST_FOR_EACH_F(R,FP,I,X) BOOST_PP_TUPLE_ELEM(2,0,FP)(R,BOOST_PP_TUPLE_ELEM(2,1,FP),X)
|
||||
#endif
|
||||
|
@ -17,22 +17,22 @@
|
||||
#include <boost/preprocessor/inc.hpp>
|
||||
#include <boost/preprocessor/for.hpp>
|
||||
|
||||
/** <p>Repeats <code>F(R,P,I,BOOST_PP_LIST_AT(L,I))</code> for each I = [0,
|
||||
BOOST_PP_LIST_SIZE(L)[.</p>
|
||||
/** <p>Repeats <code>MACRO(R,DATA,INDEX,BOOST_PP_LIST_AT(LIST,INDEX))</code> for each INDEX = [0,
|
||||
BOOST_PP_LIST_SIZE(LIST)[.</p>
|
||||
|
||||
<p>In other words, expands to the sequence:</p>
|
||||
|
||||
<pre>
|
||||
F(R,P,0,BOOST_PP_LIST_AT(L,0))
|
||||
F(R,P,1,BOOST_PP_LIST_AT(L,1))
|
||||
MACRO(R,DATA,0,BOOST_PP_LIST_AT(LIST,0))
|
||||
MACRO(R,DATA,1,BOOST_PP_LIST_AT(LIST,1))
|
||||
...
|
||||
F(R,P,BOOST_PP_DEC(BOOST_PP_LIST_SIZE(L)),BOOST_PP_LIST_AT(L,BOOST_PP_DEC(BOOST_PP_LIST_SIZE(L))))
|
||||
MACRO(R,DATA,BOOST_PP_DEC(BOOST_PP_LIST_SIZE(LIST)),BOOST_PP_LIST_AT(LIST,BOOST_PP_DEC(BOOST_PP_LIST_SIZE(LIST))))
|
||||
</pre>
|
||||
|
||||
<p>For example,</p>
|
||||
|
||||
<pre>
|
||||
#define TEST(R,P,I,X) BOOST_PP_CAT(P,X)(I);
|
||||
#define TEST(R,DATA,INDEX,X) BOOST_PP_CAT(DATA,X)(INDEX);
|
||||
BOOST_PP_LIST_FOR_EACH_I(TEST,prefix_,BOOST_PP_TUPLE_TO_LIST(3,(A,B,C)))
|
||||
</pre>
|
||||
|
||||
@ -47,10 +47,10 @@ BOOST_PP_LIST_SIZE(L)[.</p>
|
||||
<li>BOOST_PP_FOR() (see for explanation of the R parameter)</li>
|
||||
</ul>
|
||||
*/
|
||||
#define BOOST_PP_LIST_FOR_EACH_I(F,P,L) BOOST_PP_LIST_FOR_EACH_I_R(0,F,P,L)
|
||||
#define BOOST_PP_LIST_FOR_EACH_I(MACRO,DATA,LIST) BOOST_PP_LIST_FOR_EACH_I_R(0,MACRO,DATA,LIST)
|
||||
|
||||
/** <p>Can be used inside BOOST_PP_FOR().</p> */
|
||||
#define BOOST_PP_LIST_FOR_EACH_I_R(R,F,P,L) BOOST_PP_FOR##R((F,P,L,0),BOOST_PP_LIST_FOR_EACH_I_C,BOOST_PP_LIST_FOR_EACH_I_F,BOOST_PP_LIST_FOR_EACH_I_I)
|
||||
#define BOOST_PP_LIST_FOR_EACH_I_R(R,MACRO,DATA,LIST) BOOST_PP_FOR##R((MACRO,DATA,LIST,0),BOOST_PP_LIST_FOR_EACH_I_C,BOOST_PP_LIST_FOR_EACH_I_F,BOOST_PP_LIST_FOR_EACH_I_I)
|
||||
#define BOOST_PP_LIST_FOR_EACH_I_C(R,FPLI) BOOST_PP_TUPLE_ELEM(3,2,BOOST_PP_TUPLE_ELEM(4,2,FPLI))
|
||||
#define BOOST_PP_LIST_FOR_EACH_I_F(R,FPLI) (BOOST_PP_TUPLE_ELEM(4,0,FPLI),BOOST_PP_TUPLE_ELEM(4,1,FPLI),BOOST_PP_TUPLE_ELEM(3,1,BOOST_PP_TUPLE_ELEM(4,2,FPLI)),BOOST_PP_INC(BOOST_PP_TUPLE_ELEM(4,3,FPLI)))
|
||||
#define BOOST_PP_LIST_FOR_EACH_I_I(R,FPLI) BOOST_PP_TUPLE_ELEM(4,0,FPLI)(R,BOOST_PP_TUPLE_ELEM(4,1,FPLI),BOOST_PP_TUPLE_ELEM(4,3,FPLI),BOOST_PP_TUPLE_ELEM(3,0,BOOST_PP_TUPLE_ELEM(4,2,FPLI)))
|
||||
|
@ -19,8 +19,8 @@
|
||||
#include <boost/preprocessor/tuple/reverse.hpp>
|
||||
#include <boost/preprocessor/for.hpp>
|
||||
|
||||
/** <p>Repeats <code>F(R,X)</code> for each element <code>X</code> of the
|
||||
cartesian product of the lists of the <code>N</code>-tuple <code>T_OF_L</code>.</p>
|
||||
/** <p>Repeats <code>MACRO(R,X)</code> for each element <code>X</code> of the
|
||||
cartesian product of the lists of the <code>SIZE_OF_TUPLE</code>-tuple <code>TUPLE_OF_LISTS</code>.</p>
|
||||
|
||||
<p>This macro is useful for generating code to avoid combinatorial
|
||||
explosion.</p>
|
||||
@ -60,10 +60,10 @@ explosion.</p>
|
||||
<li><a href="../../test/list_test.cpp">list_test.cpp</a></li>
|
||||
</ul>
|
||||
*/
|
||||
#define BOOST_PP_LIST_FOR_EACH_PRODUCT(F,N,T_OF_L) BOOST_PP_LIST_FOR_EACH_PRODUCT_R(0,F,N,T_OF_L)
|
||||
#define BOOST_PP_LIST_FOR_EACH_PRODUCT(MACRO,SIZE_OF_TUPLE,TUPLE_OF_LISTS) BOOST_PP_LIST_FOR_EACH_PRODUCT_R(0,MACRO,SIZE_OF_TUPLE,TUPLE_OF_LISTS)
|
||||
|
||||
/** <p>Can be used inside BOOST_PP_FOR().</p> */
|
||||
#define BOOST_PP_LIST_FOR_EACH_PRODUCT_R(R,F,N,T_OF_L) BOOST_PP_LIST_FOR_EACH_PRODUCT_R2(0,F,BOOST_PP_TUPLE_TO_LIST(N,BOOST_PP_TUPLE_REVERSE(N,T_OF_L)))
|
||||
#define BOOST_PP_LIST_FOR_EACH_PRODUCT_R(R,MACRO,SIZE_OF_TUPLE,TUPLE_OF_LISTS) BOOST_PP_LIST_FOR_EACH_PRODUCT_R2(0,MACRO,BOOST_PP_TUPLE_TO_LIST(SIZE_OF_TUPLE,BOOST_PP_TUPLE_REVERSE(SIZE_OF_TUPLE,TUPLE_OF_LISTS)))
|
||||
#if !defined(BOOST_NO_COMPILER_CONFIG) && defined(__MWERKS__) ||\
|
||||
!defined(BOOST_NO_COMPILER_CONFIG) && defined(_MSC_VER)
|
||||
# define BOOST_PP_LIST_FOR_EACH_PRODUCT_R2(R,F,LL) BOOST_PP_FOR##R((BOOST_PP_TUPLE_ELEM(3,0,LL),BOOST_PP_TUPLE_ELEM(3,1,LL),(_,_,0),F),BOOST_PP_LIST_FOR_EACH_PRODUCT_C,BOOST_PP_LIST_FOR_EACH_PRODUCT_F,BOOST_PP_LIST_FOR_EACH_PRODUCT_I0)
|
||||
|
@ -17,8 +17,8 @@
|
||||
#include <boost/preprocessor/list/adt.hpp>
|
||||
#include <boost/preprocessor/while.hpp>
|
||||
|
||||
/** <p>Expands to a list of all but the first <code>N</code> elements of the
|
||||
list <code>L</code>.</p>
|
||||
/** <p>Expands to a list of all but the first <code>COUNT</code> elements of the
|
||||
list <code>LIST</code>.</p>
|
||||
|
||||
<p>For example,</p>
|
||||
|
||||
@ -47,10 +47,10 @@ list <code>L</code>.</p>
|
||||
<li><a href="../../test/list_test.cpp">list_test.cpp</a></li>
|
||||
</ul>
|
||||
*/
|
||||
#define BOOST_PP_LIST_REST_N(N,L) BOOST_PP_LIST_REST_N_D(0,N,L)
|
||||
#define BOOST_PP_LIST_REST_N(COUNT,LIST) BOOST_PP_LIST_REST_N_D(0,COUNT,LIST)
|
||||
|
||||
/** <p>Can be used inside BOOST_PP_WHILE().</p> */
|
||||
#define BOOST_PP_LIST_REST_N_D(D,N,L) BOOST_PP_TUPLE_ELEM(2,0,BOOST_PP_WHILE##D(BOOST_PP_LIST_REST_N_C,BOOST_PP_LIST_REST_N_F,(L,N)))
|
||||
#define BOOST_PP_LIST_REST_N_D(D,COUNT,LIST) BOOST_PP_TUPLE_ELEM(2,0,BOOST_PP_WHILE##D(BOOST_PP_LIST_REST_N_C,BOOST_PP_LIST_REST_N_F,(LIST,COUNT)))
|
||||
#if !defined(BOOST_NO_COMPILER_CONFIG) && defined(__MWERKS__)
|
||||
# define BOOST_PP_LIST_REST_N_C(D,X) BOOST_PP_TUPLE_ELEM(2,1,X)
|
||||
# define BOOST_PP_LIST_REST_N_F(D,X) (BOOST_PP_TUPLE_ELEM(3,1,BOOST_PP_TUPLE_ELEM(2,0,X)),BOOST_PP_DEC(BOOST_PP_TUPLE_ELEM(2,1,X)))
|
||||
|
@ -39,9 +39,9 @@
|
||||
<li><a href="../../test/list_test.cpp">list_test.cpp</a></li>
|
||||
</ul>
|
||||
*/
|
||||
#define BOOST_PP_LIST_REVERSE(L) BOOST_PP_LIST_REVERSE_D(0,L)
|
||||
#define BOOST_PP_LIST_REVERSE(LIST) BOOST_PP_LIST_REVERSE_D(0,LIST)
|
||||
|
||||
/** <p>Can be used inside BOOST_PP_WHILE().</p> */
|
||||
#define BOOST_PP_LIST_REVERSE_D(D,L) BOOST_PP_LIST_FOLD_LEFT_D(D,BOOST_PP_LIST_REVERSE_F,(_,_,0),L)
|
||||
#define BOOST_PP_LIST_REVERSE_D(D,LIST) BOOST_PP_LIST_FOLD_LEFT_D(D,BOOST_PP_LIST_REVERSE_F,(_,_,0),LIST)
|
||||
#define BOOST_PP_LIST_REVERSE_F(D,P,H) (H,P,1)
|
||||
#endif
|
||||
|
@ -36,9 +36,9 @@
|
||||
<li><a href="../../test/list_test.cpp">list_test.cpp</a></li>
|
||||
</ul>
|
||||
*/
|
||||
#define BOOST_PP_LIST_SIZE(L) BOOST_PP_LIST_SIZE_D(0,L)
|
||||
#define BOOST_PP_LIST_SIZE(LIST) BOOST_PP_LIST_SIZE_D(0,LIST)
|
||||
|
||||
/** <p>Can be used inside BOOST_PP_WHILE().</p> */
|
||||
#define BOOST_PP_LIST_SIZE_D(D,L) BOOST_PP_LIST_FOLD_LEFT_D(D,BOOST_PP_LIST_SIZE_F,0,L)
|
||||
#define BOOST_PP_LIST_SIZE_D(D,LIST) BOOST_PP_LIST_FOLD_LEFT_D(D,BOOST_PP_LIST_SIZE_F,0,LIST)
|
||||
#define BOOST_PP_LIST_SIZE_F(D,P,H) BOOST_PP_INC(P)
|
||||
#endif
|
||||
|
@ -41,8 +41,8 @@
|
||||
<li><a href="../../test/list_test.cpp">list_test.cpp</a></li>
|
||||
</ul>
|
||||
*/
|
||||
#define BOOST_PP_LIST_TO_TUPLE(L) BOOST_PP_LIST_TO_TUPLE_R(0,L)
|
||||
#define BOOST_PP_LIST_TO_TUPLE(LIST) BOOST_PP_LIST_TO_TUPLE_R(0,LIST)
|
||||
|
||||
/** <p>Can be used inside BOOST_PP_FOR().</p> */
|
||||
#define BOOST_PP_LIST_TO_TUPLE_R(R,L) (BOOST_PP_LIST_ENUM_R(R,L))
|
||||
#define BOOST_PP_LIST_TO_TUPLE_R(R,LIST) (BOOST_PP_LIST_ENUM_R(R,LIST))
|
||||
#endif
|
||||
|
@ -15,16 +15,16 @@
|
||||
|
||||
#include <boost/preprocessor/list/fold_right.hpp>
|
||||
|
||||
/** <p>Applies the macro <code>F(D,P,X)</code> to each element <code>X</code>
|
||||
/** <p>Applies the macro <code>OP(D,DATA,X)</code> to each element <code>X</code>
|
||||
of the list producing a new list.</p>
|
||||
|
||||
<p>In other words, expands to:</p>
|
||||
|
||||
<pre>
|
||||
BOOST_PP_LIST_CONS(F(D,P,BOOST_PP_LIST_AT(L,0)),
|
||||
BOOST_PP_LIST_CONS(F(D,P,BOOST_PP_LIST_AT(L,1)),
|
||||
BOOST_PP_LIST_CONS(OP(D,DATA,BOOST_PP_LIST_AT(LIST,0)),
|
||||
BOOST_PP_LIST_CONS(OP(D,DATA,BOOST_PP_LIST_AT(LIST,1)),
|
||||
...
|
||||
BOOST_PP_LIST_CONS(F(D,P,BOOST_PP_LIST_AT(L,BOOST_PP_DEC(BOOST_PP_LIST_SIZE(L)))),
|
||||
BOOST_PP_LIST_CONS(OP(D,DATA,BOOST_PP_LIST_AT(LIST,BOOST_PP_DEC(BOOST_PP_LIST_SIZE(LIST)))),
|
||||
BOOST_PP_LIST_NIL) ... ))
|
||||
</pre>
|
||||
|
||||
@ -51,10 +51,10 @@ of the list producing a new list.</p>
|
||||
<li><a href="../../test/list_test.cpp">list_test.cpp</a></li>
|
||||
</ul>
|
||||
*/
|
||||
#define BOOST_PP_LIST_TRANSFORM(F,P,L) BOOST_PP_LIST_TRANSFORM_D(0,F,P,L)
|
||||
#define BOOST_PP_LIST_TRANSFORM(OP,DATA,LIST) BOOST_PP_LIST_TRANSFORM_D(0,OP,DATA,LIST)
|
||||
|
||||
/** <p>Can be used inside BOOST_PP_WHILE().</p> */
|
||||
#define BOOST_PP_LIST_TRANSFORM_D(D,F,P,L) BOOST_PP_TUPLE_ELEM(3,2,BOOST_PP_LIST_FOLD_RIGHT_D(D,BOOST_PP_LIST_TRANSFORM_F,L,(F,P,(_,_,0))))
|
||||
#define BOOST_PP_LIST_TRANSFORM_D(D,OP,DATA,LIST) BOOST_PP_TUPLE_ELEM(3,2,BOOST_PP_LIST_FOLD_RIGHT_D(D,BOOST_PP_LIST_TRANSFORM_F,LIST,(OP,DATA,(_,_,0))))
|
||||
#if !defined(BOOST_NO_COMPILER_CONFIG) && defined(__MWERKS__)
|
||||
# define BOOST_PP_LIST_TRANSFORM_F(D,H,P) (BOOST_PP_TUPLE_ELEM(3,0,P),BOOST_PP_TUPLE_ELEM(3,1,P),(BOOST_PP_TUPLE_ELEM(3,0,P)(D,BOOST_PP_TUPLE_ELEM(3,1,P),H),BOOST_PP_TUPLE_ELEM(3,2,P),1))
|
||||
#elif !defined(BOOST_NO_COMPILER_CONFIG) && defined(_MSC_VER)
|
||||
|
@ -13,18 +13,18 @@
|
||||
* See http://www.boost.org for most recent version.
|
||||
*/
|
||||
|
||||
/** <p>Repeats the macro <code>M(I,P)</code> for <code>I = [0,N[</code>.</p>
|
||||
/** <p>Repeats the macro <code>MACRO(INDEX,DATA)</code> for <code>INDEX = [0,COUNT[</code>.</p>
|
||||
|
||||
<p>In other words, expands to the sequence:</p>
|
||||
|
||||
<pre>
|
||||
M(0,P) M(1,P) ... M(BOOST_PP_DEC(N),P)
|
||||
MACRO(0,DATA) MACRO(1,DATA) ... MACRO(BOOST_PP_DEC(COUNT),DATA)
|
||||
</pre>
|
||||
|
||||
<p>For example,</p>
|
||||
|
||||
<pre>
|
||||
#define TEST(I,P) P(I);
|
||||
#define TEST(INDEX,DATA) DATA(INDEX);
|
||||
BOOST_PP_REPEAT(3,TEST,X)
|
||||
</pre>
|
||||
|
||||
@ -51,7 +51,7 @@ BOOST_PP_REPEAT_3RD() macros.</p>
|
||||
<li>BOOST_PP_LIMIT_MAG</li>
|
||||
</ul>
|
||||
*/
|
||||
#define BOOST_PP_REPEAT(N,M,P) BOOST_PP_REPEAT_DELAY(N,M,P)
|
||||
#define BOOST_PP_REPEAT(COUNT,MACRO,DATA) BOOST_PP_REPEAT_DELAY(COUNT,MACRO,DATA)
|
||||
|
||||
#define BOOST_PP_REPEAT_DELAY(N,M,P) BOOST_PP_REPEAT##N(M,P)
|
||||
#define BOOST_PP_REPEAT0(M,P)
|
||||
|
@ -20,7 +20,7 @@
|
||||
<li><a href="../../test/repeat_2nd_test.cpp">repeat_2nd_test.cpp</a></li>
|
||||
</ul>
|
||||
*/
|
||||
#define BOOST_PP_REPEAT_2ND(N,M,P) BOOST_PP_REPEAT_2ND_DELAY(N,M,P)
|
||||
#define BOOST_PP_REPEAT_2ND(COUNT,MACRO,DATA) BOOST_PP_REPEAT_2ND_DELAY(COUNT,MACRO,DATA)
|
||||
|
||||
#define BOOST_PP_REPEAT_2ND_DELAY(N,M,P) BOOST_PP_REPEAT_2ND##N(M,P)
|
||||
#define BOOST_PP_REPEAT_2ND0(M,P)
|
||||
|
@ -14,7 +14,7 @@
|
||||
*/
|
||||
|
||||
/** <p>Same as BOOST_PP_REPEAT(), but implemented independently.</p> */
|
||||
#define BOOST_PP_REPEAT_3RD(N,M,P) BOOST_PP_REPEAT_3RD_DELAY(N,M,P)
|
||||
#define BOOST_PP_REPEAT_3RD(COUNT,MACRO,DATA) BOOST_PP_REPEAT_3RD_DELAY(COUNT,MACRO,DATA)
|
||||
|
||||
#define BOOST_PP_REPEAT_3RD_DELAY(N,M,P) BOOST_PP_REPEAT_3RD##N(M,P)
|
||||
#define BOOST_PP_REPEAT_3RD0(M,P)
|
||||
|
@ -17,18 +17,18 @@
|
||||
#include <boost/preprocessor/arithmetic/sub.hpp>
|
||||
#include <boost/preprocessor/arithmetic/add.hpp>
|
||||
|
||||
/** <p>Repeats the macro <code>M(I,P)</code> for <code>I = [S,E[</code>.</p>
|
||||
/** <p>Repeats the macro <code>MACRO(INDEX,DATA)</code> for <code>INDEX = [FIRST,LAST[</code>.</p>
|
||||
|
||||
<p>In other words, expands to the sequence:</p>
|
||||
|
||||
<pre>
|
||||
M(S,P) M(BOOST_PP_INC(S),P) ... M(BOOST_PP_DEC(E),P)
|
||||
MACRO(FIRST,DATA) MACRO(BOOST_PP_INC(FIRST),DATA) ... MACRO(BOOST_PP_DEC(LAST),DATA)
|
||||
</pre>
|
||||
|
||||
<p>For example,</p>
|
||||
|
||||
<pre>
|
||||
#define TEST(I,P) P(I);
|
||||
#define TEST(INDEX,DATA) DATA(INDEX);
|
||||
BOOST_PP_REPEAT_FROM_TO(4,7,TEST,X)
|
||||
</pre>
|
||||
|
||||
@ -48,6 +48,6 @@
|
||||
<li><a href="../../test/repeat_test.cpp">repeat_test.cpp</a></li>
|
||||
</ul>
|
||||
*/
|
||||
#define BOOST_PP_REPEAT_FROM_TO(S,E,M,P) BOOST_PP_REPEAT(BOOST_PP_SUB(E,S),BOOST_PP_REPEAT_FROM_TO_F,(S,M,P))
|
||||
#define BOOST_PP_REPEAT_FROM_TO(FIRST,LAST,MACRO,DATA) BOOST_PP_REPEAT(BOOST_PP_SUB(LAST,FIRST),BOOST_PP_REPEAT_FROM_TO_F,(FIRST,MACRO,DATA))
|
||||
#define BOOST_PP_REPEAT_FROM_TO_F(I,SMP) BOOST_PP_TUPLE_ELEM(3,1,SMP)(BOOST_PP_ADD(I,BOOST_PP_TUPLE_ELEM(3,0,SMP)),BOOST_PP_TUPLE_ELEM(3,2,SMP))
|
||||
#endif
|
||||
|
@ -18,6 +18,6 @@
|
||||
#include <boost/preprocessor/arithmetic/add.hpp>
|
||||
|
||||
/** <p>Same as BOOST_PP_REPEAT_FROM_TO(), but implemented independently.</p> */
|
||||
#define BOOST_PP_REPEAT_FROM_TO_2ND(S,E,M,P) BOOST_PP_REPEAT_2ND(BOOST_PP_SUB(E,S),BOOST_PP_REPEAT_FROM_TO_2ND_F,(S,M,P))
|
||||
#define BOOST_PP_REPEAT_FROM_TO_2ND(FIRST,LAST,MACRO,DATA) BOOST_PP_REPEAT_2ND(BOOST_PP_SUB(LAST,FIRST),BOOST_PP_REPEAT_FROM_TO_2ND_F,(FIRST,MACRO,DATA))
|
||||
#define BOOST_PP_REPEAT_FROM_TO_2ND_F(I,SMP) BOOST_PP_TUPLE_ELEM(3,1,SMP)(BOOST_PP_ADD(I,BOOST_PP_TUPLE_ELEM(3,0,SMP)),BOOST_PP_TUPLE_ELEM(3,2,SMP))
|
||||
#endif
|
||||
|
@ -18,6 +18,6 @@
|
||||
#include <boost/preprocessor/arithmetic/add.hpp>
|
||||
|
||||
/** <p>Same as BOOST_PP_REPEAT_FROM_TO(), but implemented independently.</p> */
|
||||
#define BOOST_PP_REPEAT_FROM_TO_3RD(S,E,M,P) BOOST_PP_REPEAT_3RD(BOOST_PP_SUB(E,S),BOOST_PP_REPEAT_FROM_TO_3RD_F,(S,M,P))
|
||||
#define BOOST_PP_REPEAT_FROM_TO_3RD(FIRST,LAST,MACRO,DATA) BOOST_PP_REPEAT_3RD(BOOST_PP_SUB(LAST,FIRST),BOOST_PP_REPEAT_FROM_TO_3RD_F,(FIRST,MACRO,DATA))
|
||||
#define BOOST_PP_REPEAT_FROM_TO_3RD_F(I,SMP) BOOST_PP_TUPLE_ELEM(3,1,SMP)(BOOST_PP_ADD(I,BOOST_PP_TUPLE_ELEM(3,0,SMP)),BOOST_PP_TUPLE_ELEM(3,2,SMP))
|
||||
#endif
|
||||
|
@ -13,7 +13,7 @@
|
||||
* See http://www.boost.org for most recent version.
|
||||
*/
|
||||
|
||||
/** <p>Expands to a macro that eats a tuple of the specified length.</p>
|
||||
/** <p>Expands to a macro that eats a tuple of the specified size.</p>
|
||||
|
||||
<p>BOOST_PP_TUPLE_EAT() is designed to be used with BOOST_PP_IF() like
|
||||
BOOST_PP_EMPTY().</p>
|
||||
@ -26,7 +26,7 @@ BOOST_PP_EMPTY().</p>
|
||||
|
||||
<p>expands to nothing.</p>
|
||||
*/
|
||||
#define BOOST_PP_TUPLE_EAT(N) BOOST_PP_TUPLE_EAT_DELAY(N)
|
||||
#define BOOST_PP_TUPLE_EAT(SIZE_OF_TUPLE) BOOST_PP_TUPLE_EAT_DELAY(SIZE_OF_TUPLE)
|
||||
|
||||
#define BOOST_PP_TUPLE_EAT_DELAY(N) BOOST_PP_TUPLE##N##_EAT
|
||||
#define BOOST_PP_TUPLE0_EAT()
|
||||
|
@ -13,7 +13,7 @@
|
||||
* See http://www.boost.org for most recent version.
|
||||
*/
|
||||
|
||||
/** <p>Expands to the <code>I</code>:th element of an <code>N</code>-tuple.</p>
|
||||
/** <p>Expands to the <code>INDEX</code>:th element of an <code>SIZE_OF_TUPLE</code>-tuple.</p>
|
||||
|
||||
<p>For example,</p>
|
||||
|
||||
@ -28,7 +28,7 @@
|
||||
<li>BOOST_PP_LIMIT_TUPLE</li>
|
||||
</ul>
|
||||
*/
|
||||
#define BOOST_PP_TUPLE_ELEM(N,I,T) BOOST_PP_TUPLE_ELEM_DELAY(N,I,T)
|
||||
#define BOOST_PP_TUPLE_ELEM(SIZE_OF_TUPLE,INDEX,TUPLE) BOOST_PP_TUPLE_ELEM_DELAY(SIZE_OF_TUPLE,INDEX,TUPLE)
|
||||
|
||||
#if !defined(BOOST_NO_COMPILER_CONFIG) && defined(__MWERKS__)
|
||||
/* This is a workaround for a CodeWarrior PP bug. Strictly speaking
|
||||
|
@ -23,7 +23,7 @@
|
||||
|
||||
<p>expands to <code>(C,B,A)</code>.</p>
|
||||
*/
|
||||
#define BOOST_PP_TUPLE_REVERSE(N,T) BOOST_PP_TUPLE_REVERSE_DELAY(N,T)
|
||||
#define BOOST_PP_TUPLE_REVERSE(SIZE_OF_TUPLE,TUPLE) BOOST_PP_TUPLE_REVERSE_DELAY(SIZE_OF_TUPLE,TUPLE)
|
||||
|
||||
#if !defined(BOOST_NO_COMPILER_CONFIG) && defined(__MWERKS__)
|
||||
/* This is a workaround for a CodeWarrior PP bug. Strictly speaking
|
||||
|
@ -37,7 +37,7 @@
|
||||
<li>BOOST_PP_LIMIT_TUPLE</li>
|
||||
</ul>
|
||||
*/
|
||||
#define BOOST_PP_TUPLE_TO_LIST(N,T) BOOST_PP_TUPLE_TO_LIST_DELAY(N,T)
|
||||
#define BOOST_PP_TUPLE_TO_LIST(SIZE_OF_TUPLE,TUPLE) BOOST_PP_TUPLE_TO_LIST_DELAY(SIZE_OF_TUPLE,TUPLE)
|
||||
|
||||
#if !defined(BOOST_NO_COMPILER_CONFIG) && defined(__MWERKS__)
|
||||
/* This is a workaround for a CodeWarrior PP bug. Strictly speaking
|
||||
|
@ -16,22 +16,22 @@
|
||||
#include <boost/preprocessor/if.hpp>
|
||||
#include <boost/preprocessor/tuple/eat.hpp>
|
||||
|
||||
/** <p>Iterates <code>F(D,X)</code> while <code>C(D,X)</code> is true.</p>
|
||||
/** <p>Iterates <code>OP(D,STATE)</code> while <code>PRED(D,STATE)</code> is true.</p>
|
||||
|
||||
<p>In other words, expands to:</p>
|
||||
|
||||
<pre>
|
||||
F(D, ... F(D, F(D,X) ) ... )
|
||||
OP(D, ... OP(D, OP(D,STATE) ) ... )
|
||||
</pre>
|
||||
|
||||
<p>The depth of iteration is determined by <code>C(D,X)</code>.</p>
|
||||
<p>The depth of iteration is determined by <code>PRED(D,STATE)</code>.</p>
|
||||
|
||||
<p>For example,</p>
|
||||
|
||||
<pre>
|
||||
#define C(D,X) BOOST_PP_LESS_D(D,BOOST_PP_TUPLE_ELEM(2,0,X),BOOST_PP_TUPLE_ELEM(2,1,X))
|
||||
#define F(D,X) (BOOST_PP_INC(BOOST_PP_TUPLE_ELEM(2,0,X)),BOOST_PP_TUPLE_ELEM(2,1,X))
|
||||
BOOST_PP_WHILE(C,F,(0,3))
|
||||
#define PRED(D,STATE) BOOST_PP_LESS_D(D,BOOST_PP_TUPLE_ELEM(2,0,STATE),BOOST_PP_TUPLE_ELEM(2,1,STATE))
|
||||
#define OP(D,STATE) (BOOST_PP_INC(BOOST_PP_TUPLE_ELEM(2,0,STATE)),BOOST_PP_TUPLE_ELEM(2,1,STATE))
|
||||
BOOST_PP_WHILE(PRED,OP,(0,3))
|
||||
</pre>
|
||||
|
||||
<p>expands to:</p>
|
||||
@ -42,11 +42,11 @@
|
||||
|
||||
<h3>Legend</h3>
|
||||
<ul>
|
||||
<li><b>X</b> is the current state of iteration. The state is usually a tuple.</li>
|
||||
<li><b>C</b> is the condition for iteration. It must expand to a decimal
|
||||
<li><b>STATE</b> is the current state of iteration. The state is usually a tuple.</li>
|
||||
<li><b>PRED</b> is the condition for iteration. It must expand to a decimal
|
||||
integer literal.</li>
|
||||
<li><b>F</b> is the iterated macro. Note that if the state is a tuple, then
|
||||
F(D,X) usually expands to a tuple of the same number of elements.</li>
|
||||
<li><b>OP</b> is the iterated macro. Note that if the state is a tuple, then
|
||||
OP(D,STATE) usually expands to a tuple of the same number of elements.</li>
|
||||
<li><b>D</b> is the recursion depth and should only be used as a parameter
|
||||
to other macros using BOOST_PP_WHILE(). Such macros include
|
||||
BOOST_PP_ADD() and other arithmetic operations. For each macro using
|
||||
@ -73,7 +73,7 @@
|
||||
<li><a href="../../example/delay.c">delay.c</a></li>
|
||||
</ul>
|
||||
*/
|
||||
#define BOOST_PP_WHILE(C,F,X) BOOST_PP_WHILE_C(C(1,X),0,X)(C,F,F(1,X))
|
||||
#define BOOST_PP_WHILE(PRED,OP,STATE) BOOST_PP_WHILE_C(PRED(1,STATE),0,STATE)(PRED,OP,OP(1,STATE))
|
||||
|
||||
#define BOOST_PP_WHILE_C(C,D,X) BOOST_PP_IF(C,BOOST_PP_WHILE##D,X BOOST_PP_TUPLE3_EAT)
|
||||
#define BOOST_PP_WHILE0(C,F,X) BOOST_PP_WHILE_C(C(2,X),1,X)(C,F,F(2,X))
|
||||
|
Reference in New Issue
Block a user