mirror of
https://github.com/boostorg/preprocessor.git
synced 2025-07-12 20:16:36 +02:00
pre
[SVN r13974]
This commit is contained in:
@ -33,7 +33,7 @@ for separating macro parameters.</p>
|
|||||||
<p>For example,</p>
|
<p>For example,</p>
|
||||||
|
|
||||||
<pre>
|
<pre>
|
||||||
<a href="if.htm#BOOST_PP_IF">BOOST_PP_IF</a>(1,<a href="comma.htm#BOOST_PP_COMMA">BOOST_PP_COMMA</a>,<a href="empty.htm#BOOST_PP_EMPTY">BOOST_PP_EMPTY</a>)()
|
<a href="if.htm#BOOST_PP_IF">BOOST_PP_IF</a>(1,<a href="comma.htm#BOOST_PP_COMMA">BOOST_PP_COMMA</a>,<a href="empty.htm#BOOST_PP_EMPTY">BOOST_PP_EMPTY</a>)()
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
<p>expands to a comma.</p>
|
<p>expands to a comma.</p>
|
||||||
|
@ -30,7 +30,7 @@
|
|||||||
<p>For example,</p>
|
<p>For example,</p>
|
||||||
|
|
||||||
<pre>
|
<pre>
|
||||||
<a href="if.htm#BOOST_PP_IF">BOOST_PP_IF</a>(0,<a href="comma.htm#BOOST_PP_COMMA">BOOST_PP_COMMA</a>,<a href="empty.htm#BOOST_PP_EMPTY">BOOST_PP_EMPTY</a>)()
|
<a href="if.htm#BOOST_PP_IF">BOOST_PP_IF</a>(0,<a href="comma.htm#BOOST_PP_COMMA">BOOST_PP_COMMA</a>,<a href="empty.htm#BOOST_PP_EMPTY">BOOST_PP_EMPTY</a>)()
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
<p>expands to nothing.</p>
|
<p>expands to nothing.</p>
|
||||||
|
@ -30,21 +30,21 @@
|
|||||||
<p>In other words, expands to the sequence:</p>
|
<p>In other words, expands to the sequence:</p>
|
||||||
|
|
||||||
<pre>
|
<pre>
|
||||||
MACRO(0,DATA), MACRO(1,DATA), ..., MACRO(<a href="dec.htm#BOOST_PP_DEC">BOOST_PP_DEC</a>(COUNT),DATA)
|
MACRO(0,DATA), MACRO(1,DATA), ..., MACRO(<a href="dec.htm#BOOST_PP_DEC">BOOST_PP_DEC</a>(COUNT),DATA)
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
<p>For example,</p>
|
<p>For example,</p>
|
||||||
|
|
||||||
<pre>
|
<pre>
|
||||||
#define TYPED_PARAM(INDEX,DATA)\
|
#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="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))
|
<a href="enum.htm#BOOST_PP_ENUM">BOOST_PP_ENUM</a>(3,TYPED_PARAM,(X,x))
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
<p>expands to:</p>
|
<p>expands to:</p>
|
||||||
|
|
||||||
<pre>
|
<pre>
|
||||||
X0 x0, X1 x1, X2 x2
|
X0 x0, X1 x1, X2 x2
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
<h3>Uses</h3>
|
<h3>Uses</h3>
|
||||||
|
@ -30,19 +30,19 @@
|
|||||||
<p>In other words, expands to the sequence:</p>
|
<p>In other words, expands to the sequence:</p>
|
||||||
|
|
||||||
<pre>
|
<pre>
|
||||||
<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))
|
<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>
|
</pre>
|
||||||
|
|
||||||
<p>For example,</p>
|
<p>For example,</p>
|
||||||
|
|
||||||
<pre>
|
<pre>
|
||||||
<a href="enum_params.htm#BOOST_PP_ENUM_PARAMS">BOOST_PP_ENUM_PARAMS</a>(3,x)
|
<a href="enum_params.htm#BOOST_PP_ENUM_PARAMS">BOOST_PP_ENUM_PARAMS</a>(3,x)
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
<p>expands to:</p>
|
<p>expands to:</p>
|
||||||
|
|
||||||
<pre>
|
<pre>
|
||||||
x0, x1, x2
|
x0, x1, x2
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
<h3>Uses</h3>
|
<h3>Uses</h3>
|
||||||
|
@ -30,22 +30,22 @@
|
|||||||
<p>In other words, expands to the sequence:</p>
|
<p>In other words, expands to the sequence:</p>
|
||||||
|
|
||||||
<pre>
|
<pre>
|
||||||
<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,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,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
|
<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>
|
</pre>
|
||||||
|
|
||||||
<p>For example,</p>
|
<p>For example,</p>
|
||||||
|
|
||||||
<pre>
|
<pre>
|
||||||
<a href="enum_params_with_a_default.htm#BOOST_PP_ENUM_PARAMS_WITH_A_DEFAULT">BOOST_PP_ENUM_PARAMS_WITH_A_DEFAULT</a>(3,x,y)
|
<a href="enum_params_with_a_default.htm#BOOST_PP_ENUM_PARAMS_WITH_A_DEFAULT">BOOST_PP_ENUM_PARAMS_WITH_A_DEFAULT</a>(3,x,y)
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
<p>expands to:</p>
|
<p>expands to:</p>
|
||||||
|
|
||||||
<pre>
|
<pre>
|
||||||
x0 = y, x1 = y, x2 = y
|
x0 = y, x1 = y, x2 = y
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
<h3>Uses</h3>
|
<h3>Uses</h3>
|
||||||
|
@ -30,22 +30,22 @@
|
|||||||
<p>In other words, expands to the sequence:</p>
|
<p>In other words, expands to the sequence:</p>
|
||||||
|
|
||||||
<pre>
|
<pre>
|
||||||
<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,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>(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>(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))
|
<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>
|
</pre>
|
||||||
|
|
||||||
<p>For example,</p>
|
<p>For example,</p>
|
||||||
|
|
||||||
<pre>
|
<pre>
|
||||||
<a href="enum_params_with_defaults.htm#BOOST_PP_ENUM_PARAMS_WITH_DEFAULTS">BOOST_PP_ENUM_PARAMS_WITH_DEFAULTS</a>(3,x,y)
|
<a href="enum_params_with_defaults.htm#BOOST_PP_ENUM_PARAMS_WITH_DEFAULTS">BOOST_PP_ENUM_PARAMS_WITH_DEFAULTS</a>(3,x,y)
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
<p>expands to:</p>
|
<p>expands to:</p>
|
||||||
|
|
||||||
<pre>
|
<pre>
|
||||||
x0 = y0, x1 = y1, x2 = y2
|
x0 = y0, x1 = y1, x2 = y2
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
<h3>Uses</h3>
|
<h3>Uses</h3>
|
||||||
|
@ -30,21 +30,21 @@
|
|||||||
<p>In other words, expands to the sequence:</p>
|
<p>In other words, expands to the sequence:</p>
|
||||||
|
|
||||||
<pre>
|
<pre>
|
||||||
MACRO(1,DATA), MACRO(2,DATA), ..., MACRO(<a href="dec.htm#BOOST_PP_DEC">BOOST_PP_DEC</a>(COUNT),DATA)
|
MACRO(1,DATA), MACRO(2,DATA), ..., MACRO(<a href="dec.htm#BOOST_PP_DEC">BOOST_PP_DEC</a>(COUNT),DATA)
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
<p>For example,</p>
|
<p>For example,</p>
|
||||||
|
|
||||||
<pre>
|
<pre>
|
||||||
#define TYPED_PARAM(INDEX,DATA)\
|
#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="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))
|
<a href="enum_shifted.htm#BOOST_PP_ENUM_SHIFTED">BOOST_PP_ENUM_SHIFTED</a>(3,TYPED_PARAM,(X,x))
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
<p>expands to:</p>
|
<p>expands to:</p>
|
||||||
|
|
||||||
<pre>
|
<pre>
|
||||||
X1 x1, X2 x2
|
X1 x1, X2 x2
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
<h3>Uses</h3>
|
<h3>Uses</h3>
|
||||||
|
@ -30,18 +30,18 @@
|
|||||||
<p>In other words, expands to the sequence:</p>
|
<p>In other words, expands to the sequence:</p>
|
||||||
|
|
||||||
<pre>
|
<pre>
|
||||||
<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))
|
<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>
|
</pre>
|
||||||
<p>For example,</p>
|
<p>For example,</p>
|
||||||
|
|
||||||
<pre>
|
<pre>
|
||||||
<a href="enum_shifted_params.htm#BOOST_PP_ENUM_SHIFTED_PARAMS">BOOST_PP_ENUM_SHIFTED_PARAMS</a>(3,x)
|
<a href="enum_shifted_params.htm#BOOST_PP_ENUM_SHIFTED_PARAMS">BOOST_PP_ENUM_SHIFTED_PARAMS</a>(3,x)
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
<p>expands to:</p>
|
<p>expands to:</p>
|
||||||
|
|
||||||
<pre>
|
<pre>
|
||||||
x1, x2
|
x1, x2
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
<h3>Uses</h3>
|
<h3>Uses</h3>
|
||||||
|
@ -31,11 +31,11 @@
|
|||||||
<p>In other words, expands to the sequence:</p>
|
<p>In other words, expands to the sequence:</p>
|
||||||
|
|
||||||
<pre>
|
<pre>
|
||||||
MACRO(R,STATE)
|
MACRO(R,STATE)
|
||||||
MACRO(R,OP(R,STATE))
|
MACRO(R,OP(R,STATE))
|
||||||
MACRO(R,OP(R,OP(R,STATE)))
|
MACRO(R,OP(R,OP(R,STATE)))
|
||||||
...
|
...
|
||||||
MACRO(R,OP(R,OP(...OP(R,STATE)...)))
|
MACRO(R,OP(R,OP(...OP(R,STATE)...)))
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
<p>The length of the sequence is determined by <code>PRED(R,STATE)</code>.</p>
|
<p>The length of the sequence is determined by <code>PRED(R,STATE)</code>.</p>
|
||||||
@ -43,16 +43,16 @@
|
|||||||
<p>For example,</p>
|
<p>For example,</p>
|
||||||
|
|
||||||
<pre>
|
<pre>
|
||||||
#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 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 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)
|
#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)
|
<a href="for.htm#BOOST_PP_FOR">BOOST_PP_FOR</a>((0,3),PRED,OP,MACRO)
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
<p>expands to:</p>
|
<p>expands to:</p>
|
||||||
|
|
||||||
<pre>
|
<pre>
|
||||||
0 1 2
|
0 1 2
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
<h3>Legend</h3>
|
<h3>Legend</h3>
|
||||||
|
@ -33,13 +33,13 @@ invoked.</p>
|
|||||||
<p>For example,</p>
|
<p>For example,</p>
|
||||||
|
|
||||||
<pre>
|
<pre>
|
||||||
<a href="if.htm#BOOST_PP_IF">BOOST_PP_IF</a>(1,<a href="identity.htm#BOOST_PP_IDENTITY">BOOST_PP_IDENTITY</a>(X),<a href="empty.htm#BOOST_PP_EMPTY">BOOST_PP_EMPTY</a>)<b>()</b>
|
<a href="if.htm#BOOST_PP_IF">BOOST_PP_IF</a>(1,<a href="identity.htm#BOOST_PP_IDENTITY">BOOST_PP_IDENTITY</a>(X),<a href="empty.htm#BOOST_PP_EMPTY">BOOST_PP_EMPTY</a>)<b>()</b>
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
<p>expands to:</p>
|
<p>expands to:</p>
|
||||||
|
|
||||||
<pre>
|
<pre>
|
||||||
X
|
X
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
<h3>Test</h3>
|
<h3>Test</h3>
|
||||||
|
@ -41,18 +41,18 @@
|
|||||||
<a href="list_adt.htm#BOOST_PP_LIST_CONS">BOOST_PP_LIST_CONS</a>(). For example,</p>
|
<a href="list_adt.htm#BOOST_PP_LIST_CONS">BOOST_PP_LIST_CONS</a>(). For example,</p>
|
||||||
|
|
||||||
<pre>
|
<pre>
|
||||||
<a href="list_adt.htm#BOOST_PP_LIST_CONS">BOOST_PP_LIST_CONS</a>(1,
|
<a href="list_adt.htm#BOOST_PP_LIST_CONS">BOOST_PP_LIST_CONS</a>(1,
|
||||||
<a href="list_adt.htm#BOOST_PP_LIST_CONS">BOOST_PP_LIST_CONS</a>(2,
|
<a href="list_adt.htm#BOOST_PP_LIST_CONS">BOOST_PP_LIST_CONS</a>(2,
|
||||||
<a href="list_adt.htm#BOOST_PP_LIST_CONS">BOOST_PP_LIST_CONS</a>(3,
|
<a href="list_adt.htm#BOOST_PP_LIST_CONS">BOOST_PP_LIST_CONS</a>(3,
|
||||||
<a href="list_adt.htm#BOOST_PP_LIST_CONS">BOOST_PP_LIST_CONS</a>(4,
|
<a href="list_adt.htm#BOOST_PP_LIST_CONS">BOOST_PP_LIST_CONS</a>(4,
|
||||||
<a href="list_adt.htm#BOOST_PP_LIST_CONS">BOOST_PP_LIST_CONS</a>(5,
|
<a href="list_adt.htm#BOOST_PP_LIST_CONS">BOOST_PP_LIST_CONS</a>(5,
|
||||||
<a href="list_adt.htm#BOOST_PP_LIST_NIL">BOOST_PP_LIST_NIL</a>)))))
|
<a href="list_adt.htm#BOOST_PP_LIST_NIL">BOOST_PP_LIST_NIL</a>)))))
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
<p>Short lists can also be build from tuples:</p>
|
<p>Short lists can also be build from tuples:</p>
|
||||||
|
|
||||||
<pre>
|
<pre>
|
||||||
<a href="tuple_to_list.htm#BOOST_PP_TUPLE_TO_LIST">BOOST_PP_TUPLE_TO_LIST</a>(5,(1,2,3,4,5))
|
<a href="tuple_to_list.htm#BOOST_PP_TUPLE_TO_LIST">BOOST_PP_TUPLE_TO_LIST</a>(5,(1,2,3,4,5))
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
<p>Both of the above lists contain 5 elements: 1, 2, 3, 4 and 5.</p>
|
<p>Both of the above lists contain 5 elements: 1, 2, 3, 4 and 5.</p>
|
||||||
@ -61,16 +61,16 @@
|
|||||||
and <a href="list_fold_right_2nd.htm#BOOST_PP_LIST_FOLD_RIGHT_2ND">BOOST_PP_LIST_FOLD_RIGHT_2ND</a>():</p>
|
and <a href="list_fold_right_2nd.htm#BOOST_PP_LIST_FOLD_RIGHT_2ND">BOOST_PP_LIST_FOLD_RIGHT_2ND</a>():</p>
|
||||||
|
|
||||||
<pre>
|
<pre>
|
||||||
<a href="list_fold_right_2nd.htm#BOOST_PP_LIST_FOLD_RIGHT_2ND">BOOST_PP_LIST_FOLD_RIGHT_2ND</a>
|
<a href="list_fold_right_2nd.htm#BOOST_PP_LIST_FOLD_RIGHT_2ND">BOOST_PP_LIST_FOLD_RIGHT_2ND</a>
|
||||||
( <a href="list_append.htm#BOOST_PP_LIST_APPEND_D">BOOST_PP_LIST_APPEND_D</a>
|
( <a href="list_append.htm#BOOST_PP_LIST_APPEND_D">BOOST_PP_LIST_APPEND_D</a>
|
||||||
, <a href="tuple_to_list.htm#BOOST_PP_TUPLE_TO_LIST">BOOST_PP_TUPLE_TO_LIST</a>
|
, <a href="tuple_to_list.htm#BOOST_PP_TUPLE_TO_LIST">BOOST_PP_TUPLE_TO_LIST</a>
|
||||||
( N
|
( N
|
||||||
, <a href="tuple_to_list.htm#BOOST_PP_TUPLE_TO_LIST">BOOST_PP_TUPLE_TO_LIST</a>(M, (E11, E12, ..., E1M) )
|
, <a href="tuple_to_list.htm#BOOST_PP_TUPLE_TO_LIST">BOOST_PP_TUPLE_TO_LIST</a>(M, (E11, E12, ..., E1M) )
|
||||||
, <a href="tuple_to_list.htm#BOOST_PP_TUPLE_TO_LIST">BOOST_PP_TUPLE_TO_LIST</a>(M, (E21, E22, ..., E2M) )
|
, <a href="tuple_to_list.htm#BOOST_PP_TUPLE_TO_LIST">BOOST_PP_TUPLE_TO_LIST</a>(M, (E21, E22, ..., E2M) )
|
||||||
, ...
|
, ...
|
||||||
, <a href="tuple_to_list.htm#BOOST_PP_TUPLE_TO_LIST">BOOST_PP_TUPLE_TO_LIST</a>(M, (EN1, EN2, ..., ENM) )
|
, <a href="tuple_to_list.htm#BOOST_PP_TUPLE_TO_LIST">BOOST_PP_TUPLE_TO_LIST</a>(M, (EN1, EN2, ..., ENM) )
|
||||||
)
|
|
||||||
)
|
)
|
||||||
|
)
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
<hr>
|
<hr>
|
||||||
@ -93,7 +93,7 @@ and <a href="list_fold_right_2nd.htm#BOOST_PP_LIST_FOLD_RIGHT_2ND">BOOST_PP_LIST
|
|||||||
<p>For example,</p>
|
<p>For example,</p>
|
||||||
|
|
||||||
<pre>
|
<pre>
|
||||||
<a href="list_adt.htm#BOOST_PP_LIST_FIRST">BOOST_PP_LIST_FIRST</a>(<a href="tuple_to_list.htm#BOOST_PP_TUPLE_TO_LIST">BOOST_PP_TUPLE_TO_LIST</a>(5,(1,2,3,4,5)))
|
<a href="list_adt.htm#BOOST_PP_LIST_FIRST">BOOST_PP_LIST_FIRST</a>(<a href="tuple_to_list.htm#BOOST_PP_TUPLE_TO_LIST">BOOST_PP_TUPLE_TO_LIST</a>(5,(1,2,3,4,5)))
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
<p>expands to 1.</p>
|
<p>expands to 1.</p>
|
||||||
@ -108,13 +108,13 @@ and <a href="list_fold_right_2nd.htm#BOOST_PP_LIST_FOLD_RIGHT_2ND">BOOST_PP_LIST
|
|||||||
<p>For example,</p>
|
<p>For example,</p>
|
||||||
|
|
||||||
<pre>
|
<pre>
|
||||||
<a href="list_adt.htm#BOOST_PP_LIST_REST">BOOST_PP_LIST_REST</a>(<a href="tuple_to_list.htm#BOOST_PP_TUPLE_TO_LIST">BOOST_PP_TUPLE_TO_LIST</a>(5,(1,2,3,4,5)))
|
<a href="list_adt.htm#BOOST_PP_LIST_REST">BOOST_PP_LIST_REST</a>(<a href="tuple_to_list.htm#BOOST_PP_TUPLE_TO_LIST">BOOST_PP_TUPLE_TO_LIST</a>(5,(1,2,3,4,5)))
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
<p>expands to the same as:</p>
|
<p>expands to the same as:</p>
|
||||||
|
|
||||||
<pre>
|
<pre>
|
||||||
<a href="tuple_to_list.htm#BOOST_PP_TUPLE_TO_LIST">BOOST_PP_TUPLE_TO_LIST</a>(4,(2,3,4,5))
|
<a href="tuple_to_list.htm#BOOST_PP_TUPLE_TO_LIST">BOOST_PP_TUPLE_TO_LIST</a>(4,(2,3,4,5))
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
<hr>
|
<hr>
|
||||||
|
@ -30,16 +30,16 @@
|
|||||||
<p>For example,</p>
|
<p>For example,</p>
|
||||||
|
|
||||||
<pre>
|
<pre>
|
||||||
<a href="list_append.htm#BOOST_PP_LIST_APPEND">BOOST_PP_LIST_APPEND</a>
|
<a href="list_append.htm#BOOST_PP_LIST_APPEND">BOOST_PP_LIST_APPEND</a>
|
||||||
( <a href="tuple_to_list.htm#BOOST_PP_TUPLE_TO_LIST">BOOST_PP_TUPLE_TO_LIST</a>(2,(1,2))
|
( <a href="tuple_to_list.htm#BOOST_PP_TUPLE_TO_LIST">BOOST_PP_TUPLE_TO_LIST</a>(2,(1,2))
|
||||||
, <a href="tuple_to_list.htm#BOOST_PP_TUPLE_TO_LIST">BOOST_PP_TUPLE_TO_LIST</a>(2,(3,4))
|
, <a href="tuple_to_list.htm#BOOST_PP_TUPLE_TO_LIST">BOOST_PP_TUPLE_TO_LIST</a>(2,(3,4))
|
||||||
)
|
)
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
<p>expands to the same as:</p>
|
<p>expands to the same as:</p>
|
||||||
|
|
||||||
<pre>
|
<pre>
|
||||||
<a href="tuple_to_list.htm#BOOST_PP_TUPLE_TO_LIST">BOOST_PP_TUPLE_TO_LIST</a>(4,(1,2,3,4))
|
<a href="tuple_to_list.htm#BOOST_PP_TUPLE_TO_LIST">BOOST_PP_TUPLE_TO_LIST</a>(4,(1,2,3,4))
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
<h3>Uses</h3>
|
<h3>Uses</h3>
|
||||||
|
@ -31,7 +31,7 @@ first element is at index <code>0</code>.</p>
|
|||||||
<p>For example,</p>
|
<p>For example,</p>
|
||||||
|
|
||||||
<pre>
|
<pre>
|
||||||
<a href="list_at.htm#BOOST_PP_LIST_AT">BOOST_PP_LIST_AT</a>(<a href="tuple_to_list.htm#BOOST_PP_TUPLE_TO_LIST">BOOST_PP_TUPLE_TO_LIST</a>(3,(A,B,C)),1)
|
<a href="list_at.htm#BOOST_PP_LIST_AT">BOOST_PP_LIST_AT</a>(<a href="tuple_to_list.htm#BOOST_PP_TUPLE_TO_LIST">BOOST_PP_TUPLE_TO_LIST</a>(3,(A,B,C)),1)
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
<p>expands to <code>B</code>.</p>
|
<p>expands to <code>B</code>.</p>
|
||||||
|
@ -30,13 +30,13 @@
|
|||||||
<p>For example,</p>
|
<p>For example,</p>
|
||||||
|
|
||||||
<pre>
|
<pre>
|
||||||
<a href="list_cat.htm#BOOST_PP_LIST_CAT">BOOST_PP_LIST_CAT</a>(<a href="tuple_to_list.htm#BOOST_PP_TUPLE_TO_LIST">BOOST_PP_TUPLE_TO_LIST</a>(3,(1,2,3)))
|
<a href="list_cat.htm#BOOST_PP_LIST_CAT">BOOST_PP_LIST_CAT</a>(<a href="tuple_to_list.htm#BOOST_PP_TUPLE_TO_LIST">BOOST_PP_TUPLE_TO_LIST</a>(3,(1,2,3)))
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
<p>expands to:</p>
|
<p>expands to:</p>
|
||||||
|
|
||||||
<pre>
|
<pre>
|
||||||
123
|
123
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
<h3>Uses</h3>
|
<h3>Uses</h3>
|
||||||
|
@ -30,13 +30,13 @@
|
|||||||
<p>For example,</p>
|
<p>For example,</p>
|
||||||
|
|
||||||
<pre>
|
<pre>
|
||||||
<a href="list_enum.htm#BOOST_PP_LIST_ENUM">BOOST_PP_LIST_ENUM</a>(<a href="tuple_to_list.htm#BOOST_PP_TUPLE_TO_LIST">BOOST_PP_TUPLE_TO_LIST</a>(3,(A,B,C)))
|
<a href="list_enum.htm#BOOST_PP_LIST_ENUM">BOOST_PP_LIST_ENUM</a>(<a href="tuple_to_list.htm#BOOST_PP_TUPLE_TO_LIST">BOOST_PP_TUPLE_TO_LIST</a>(3,(A,B,C)))
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
<p>expands to:</p>
|
<p>expands to:</p>
|
||||||
|
|
||||||
<pre>
|
<pre>
|
||||||
A,B,C
|
A,B,C
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
<h3>Uses</h3>
|
<h3>Uses</h3>
|
||||||
|
@ -31,13 +31,13 @@ for which <code>PRED(D,DATA,X)</code> is true.</p>
|
|||||||
<p>For example,</p>
|
<p>For example,</p>
|
||||||
|
|
||||||
<pre>
|
<pre>
|
||||||
<a href="list_filter.htm#BOOST_PP_LIST_FILTER">BOOST_PP_LIST_FILTER</a>(<a href="comparison_not_equal.htm#BOOST_PP_NOT_EQUAL_D">BOOST_PP_NOT_EQUAL_D</a>,2,<a href="tuple_to_list.htm#BOOST_PP_TUPLE_TO_LIST">BOOST_PP_TUPLE_TO_LIST</a>(3,(1,2,3)))
|
<a href="list_filter.htm#BOOST_PP_LIST_FILTER">BOOST_PP_LIST_FILTER</a>(<a href="comparison_not_equal.htm#BOOST_PP_NOT_EQUAL_D">BOOST_PP_NOT_EQUAL_D</a>,2,<a href="tuple_to_list.htm#BOOST_PP_TUPLE_TO_LIST">BOOST_PP_TUPLE_TO_LIST</a>(3,(1,2,3)))
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
<p>expands to the same as:</p>
|
<p>expands to the same as:</p>
|
||||||
|
|
||||||
<pre>
|
<pre>
|
||||||
<a href="tuple_to_list.htm#BOOST_PP_TUPLE_TO_LIST">BOOST_PP_TUPLE_TO_LIST</a>(2,(1,3))
|
<a href="tuple_to_list.htm#BOOST_PP_TUPLE_TO_LIST">BOOST_PP_TUPLE_TO_LIST</a>(2,(1,3))
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
<h3>Uses</h3>
|
<h3>Uses</h3>
|
||||||
|
@ -31,13 +31,13 @@
|
|||||||
<p>For example,</p>
|
<p>For example,</p>
|
||||||
|
|
||||||
<pre>
|
<pre>
|
||||||
<a href="list_first_n.htm#BOOST_PP_LIST_FIRST_N">BOOST_PP_LIST_FIRST_N</a>(2,<a href="tuple_to_list.htm#BOOST_PP_TUPLE_TO_LIST">BOOST_PP_TUPLE_TO_LIST</a>(4,(+,-,*,/)))
|
<a href="list_first_n.htm#BOOST_PP_LIST_FIRST_N">BOOST_PP_LIST_FIRST_N</a>(2,<a href="tuple_to_list.htm#BOOST_PP_TUPLE_TO_LIST">BOOST_PP_TUPLE_TO_LIST</a>(4,(+,-,*,/)))
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
<p>expands to the same as:</p>
|
<p>expands to the same as:</p>
|
||||||
|
|
||||||
<pre>
|
<pre>
|
||||||
<a href="tuple_to_list.htm#BOOST_PP_TUPLE_TO_LIST">BOOST_PP_TUPLE_TO_LIST</a>(2,(+,-))
|
<a href="tuple_to_list.htm#BOOST_PP_TUPLE_TO_LIST">BOOST_PP_TUPLE_TO_LIST</a>(2,(+,-))
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
<h3>See</h3>
|
<h3>See</h3>
|
||||||
|
@ -31,24 +31,24 @@ list <code>LIST</code> (from the left or the start of the list).</p>
|
|||||||
<p>In other words, expands to:</p>
|
<p>In other words, expands to:</p>
|
||||||
|
|
||||||
<pre>
|
<pre>
|
||||||
OP
|
OP
|
||||||
( D
|
( D
|
||||||
, ... 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)) ...
|
, ... 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))
|
, <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>
|
</pre>
|
||||||
|
|
||||||
<p>For example,</p>
|
<p>For example,</p>
|
||||||
|
|
||||||
<pre>
|
<pre>
|
||||||
#define TEST(D,STATE,X) <a href="cat.htm#BOOST_PP_CAT">BOOST_PP_CAT</a>(STATE,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)))
|
<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>
|
</pre>
|
||||||
|
|
||||||
<p>expands to:</p>
|
<p>expands to:</p>
|
||||||
|
|
||||||
<pre>
|
<pre>
|
||||||
_ABC
|
_ABC
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
<h3>Note</h3>
|
<h3>Note</h3>
|
||||||
|
@ -31,32 +31,32 @@ list <code>LIST</code> (from the right or the end of the list).</p>
|
|||||||
<p>In other words, expands to:</p>
|
<p>In other words, expands to:</p>
|
||||||
|
|
||||||
<pre>
|
<pre>
|
||||||
OP
|
OP
|
||||||
( D
|
( D
|
||||||
, <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,0)
|
||||||
, ... OP
|
, ... OP
|
||||||
|
( D
|
||||||
|
, <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
|
( D
|
||||||
, <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))
|
, <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))
|
||||||
, OP
|
, STATE
|
||||||
( D
|
)
|
||||||
, <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
|
)
|
||||||
)
|
|
||||||
) ...
|
|
||||||
)
|
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
<p>For example,</p>
|
<p>For example,</p>
|
||||||
|
|
||||||
<pre>
|
<pre>
|
||||||
#define TEST(D,X,STATE) <a href="cat.htm#BOOST_PP_CAT">BOOST_PP_CAT</a>(STATE,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)))
|
<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>
|
</pre>
|
||||||
|
|
||||||
<p>expands to:</p>
|
<p>expands to:</p>
|
||||||
|
|
||||||
<pre>
|
<pre>
|
||||||
_CBA
|
_CBA
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
<h3>Uses</h3>
|
<h3>Uses</h3>
|
||||||
|
@ -31,23 +31,23 @@
|
|||||||
<p>In other words, expands to the sequence:</p>
|
<p>In other words, expands to the sequence:</p>
|
||||||
|
|
||||||
<pre>
|
<pre>
|
||||||
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,0))
|
||||||
MACRO(R,DATA,<a href="list_at.htm#BOOST_PP_LIST_AT">BOOST_PP_LIST_AT</a>(LIST,1))
|
MACRO(R,DATA,<a href="list_at.htm#BOOST_PP_LIST_AT">BOOST_PP_LIST_AT</a>(LIST,1))
|
||||||
...
|
...
|
||||||
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))))
|
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>
|
</pre>
|
||||||
|
|
||||||
<p>For example,</p>
|
<p>For example,</p>
|
||||||
|
|
||||||
<pre>
|
<pre>
|
||||||
#define TEST(R,DATA,X) <a href="cat.htm#BOOST_PP_CAT">BOOST_PP_CAT</a>(DATA,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)))
|
<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>
|
</pre>
|
||||||
|
|
||||||
<p>expands to:</p>
|
<p>expands to:</p>
|
||||||
|
|
||||||
<pre>
|
<pre>
|
||||||
prefix_A(); prefix_B(); prefix_C();
|
prefix_A(); prefix_B(); prefix_C();
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
<h3>Example</h3>
|
<h3>Example</h3>
|
||||||
|
@ -31,23 +31,23 @@
|
|||||||
<p>In other words, expands to the sequence:</p>
|
<p>In other words, expands to the sequence:</p>
|
||||||
|
|
||||||
<pre>
|
<pre>
|
||||||
MACRO(R,DATA,0,<a href="list_at.htm#BOOST_PP_LIST_AT">BOOST_PP_LIST_AT</a>(LIST,0))
|
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))
|
MACRO(R,DATA,1,<a href="list_at.htm#BOOST_PP_LIST_AT">BOOST_PP_LIST_AT</a>(LIST,1))
|
||||||
...
|
...
|
||||||
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))))
|
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>
|
</pre>
|
||||||
|
|
||||||
<p>For example,</p>
|
<p>For example,</p>
|
||||||
|
|
||||||
<pre>
|
<pre>
|
||||||
#define TEST(R,DATA,INDEX,X) <a href="cat.htm#BOOST_PP_CAT">BOOST_PP_CAT</a>(DATA,X)(INDEX);
|
#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)))
|
<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>
|
</pre>
|
||||||
|
|
||||||
<p>expands to:</p>
|
<p>expands to:</p>
|
||||||
|
|
||||||
<pre>
|
<pre>
|
||||||
prefix_A(0); prefix_B(1); prefix_C(2);
|
prefix_A(0); prefix_B(1); prefix_C(2);
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
<h3>Uses</h3>
|
<h3>Uses</h3>
|
||||||
|
@ -34,20 +34,20 @@ explosion.</p>
|
|||||||
<p>For example,</p>
|
<p>For example,</p>
|
||||||
|
|
||||||
<pre>
|
<pre>
|
||||||
#define TEST(R,X) X
|
#define TEST(R,X) X
|
||||||
<a href="list_for_each_product.htm#BOOST_PP_LIST_FOR_EACH_PRODUCT">BOOST_PP_LIST_FOR_EACH_PRODUCT</a>
|
<a href="list_for_each_product.htm#BOOST_PP_LIST_FOR_EACH_PRODUCT">BOOST_PP_LIST_FOR_EACH_PRODUCT</a>
|
||||||
( TEST
|
( TEST
|
||||||
, 2
|
, 2
|
||||||
, ( <a href="tuple_to_list.htm#BOOST_PP_TUPLE_TO_LIST">BOOST_PP_TUPLE_TO_LIST</a>(3,(A,B,C))
|
, ( <a href="tuple_to_list.htm#BOOST_PP_TUPLE_TO_LIST">BOOST_PP_TUPLE_TO_LIST</a>(3,(A,B,C))
|
||||||
, <a href="tuple_to_list.htm#BOOST_PP_TUPLE_TO_LIST">BOOST_PP_TUPLE_TO_LIST</a>(2,(1,2))
|
, <a href="tuple_to_list.htm#BOOST_PP_TUPLE_TO_LIST">BOOST_PP_TUPLE_TO_LIST</a>(2,(1,2))
|
||||||
)
|
|
||||||
)
|
)
|
||||||
|
)
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
<p>expands to:</p>
|
<p>expands to:</p>
|
||||||
|
|
||||||
<pre>
|
<pre>
|
||||||
(A,1) (A,2) (B,1) (B,2) (C,1) (C,2)
|
(A,1) (A,2) (B,1) (B,2) (C,1) (C,2)
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
<h3>Example</h3>
|
<h3>Example</h3>
|
||||||
|
@ -31,13 +31,13 @@ list <code>LIST</code>.</p>
|
|||||||
<p>For example,</p>
|
<p>For example,</p>
|
||||||
|
|
||||||
<pre>
|
<pre>
|
||||||
<a href="list_rest_n.htm#BOOST_PP_LIST_REST_N">BOOST_PP_LIST_REST_N</a>(2,<a href="tuple_to_list.htm#BOOST_PP_TUPLE_TO_LIST">BOOST_PP_TUPLE_TO_LIST</a>(4,(+,-,*,/)))
|
<a href="list_rest_n.htm#BOOST_PP_LIST_REST_N">BOOST_PP_LIST_REST_N</a>(2,<a href="tuple_to_list.htm#BOOST_PP_TUPLE_TO_LIST">BOOST_PP_TUPLE_TO_LIST</a>(4,(+,-,*,/)))
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
<p>expands to the same as:</p>
|
<p>expands to the same as:</p>
|
||||||
|
|
||||||
<pre>
|
<pre>
|
||||||
<a href="tuple_to_list.htm#BOOST_PP_TUPLE_TO_LIST">BOOST_PP_TUPLE_TO_LIST</a>(2,(*,/))
|
<a href="tuple_to_list.htm#BOOST_PP_TUPLE_TO_LIST">BOOST_PP_TUPLE_TO_LIST</a>(2,(*,/))
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
<h3>See</h3>
|
<h3>See</h3>
|
||||||
|
@ -30,13 +30,13 @@
|
|||||||
<p>For example,</p>
|
<p>For example,</p>
|
||||||
|
|
||||||
<pre>
|
<pre>
|
||||||
<a href="list_reverse.htm#BOOST_PP_LIST_REVERSE">BOOST_PP_LIST_REVERSE</a>(<a href="tuple_to_list.htm#BOOST_PP_TUPLE_TO_LIST">BOOST_PP_TUPLE_TO_LIST</a>(3,(A,B,C)))
|
<a href="list_reverse.htm#BOOST_PP_LIST_REVERSE">BOOST_PP_LIST_REVERSE</a>(<a href="tuple_to_list.htm#BOOST_PP_TUPLE_TO_LIST">BOOST_PP_TUPLE_TO_LIST</a>(3,(A,B,C)))
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
<p>expands to the same as:</p>
|
<p>expands to the same as:</p>
|
||||||
|
|
||||||
<pre>
|
<pre>
|
||||||
<a href="tuple_to_list.htm#BOOST_PP_TUPLE_TO_LIST">BOOST_PP_TUPLE_TO_LIST</a>(3,(C,B,A))
|
<a href="tuple_to_list.htm#BOOST_PP_TUPLE_TO_LIST">BOOST_PP_TUPLE_TO_LIST</a>(3,(C,B,A))
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
<h3>Uses</h3>
|
<h3>Uses</h3>
|
||||||
|
@ -30,7 +30,7 @@
|
|||||||
<p>For example,</p>
|
<p>For example,</p>
|
||||||
|
|
||||||
<pre>
|
<pre>
|
||||||
<a href="list_size.htm#BOOST_PP_LIST_SIZE">BOOST_PP_LIST_SIZE</a>(<a href="tuple_to_list.htm#BOOST_PP_TUPLE_TO_LIST">BOOST_PP_TUPLE_TO_LIST</a>(3,(A,B,C)))
|
<a href="list_size.htm#BOOST_PP_LIST_SIZE">BOOST_PP_LIST_SIZE</a>(<a href="tuple_to_list.htm#BOOST_PP_TUPLE_TO_LIST">BOOST_PP_TUPLE_TO_LIST</a>(3,(A,B,C)))
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
<p>expands to <code>3</code>.</p>
|
<p>expands to <code>3</code>.</p>
|
||||||
|
@ -30,7 +30,7 @@
|
|||||||
<p>For example,</p>
|
<p>For example,</p>
|
||||||
|
|
||||||
<pre>
|
<pre>
|
||||||
<a href="list_to_tuple.htm#BOOST_PP_LIST_TO_TUPLE">BOOST_PP_LIST_TO_TUPLE</a>(<a href="tuple_to_list.htm#BOOST_PP_TUPLE_TO_LIST">BOOST_PP_TUPLE_TO_LIST</a>(3,(A,B,C)))
|
<a href="list_to_tuple.htm#BOOST_PP_LIST_TO_TUPLE">BOOST_PP_LIST_TO_TUPLE</a>(<a href="tuple_to_list.htm#BOOST_PP_TUPLE_TO_LIST">BOOST_PP_TUPLE_TO_LIST</a>(3,(A,B,C)))
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
<p>expands to <code>(A,B,C)</code>.</p>
|
<p>expands to <code>(A,B,C)</code>.</p>
|
||||||
|
@ -31,23 +31,23 @@ of the list producing a new list.</p>
|
|||||||
<p>In other words, expands to:</p>
|
<p>In other words, expands to:</p>
|
||||||
|
|
||||||
<pre>
|
<pre>
|
||||||
<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,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>(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>(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_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>) ... ))
|
<a href="list_adt.htm#BOOST_PP_LIST_NIL">BOOST_PP_LIST_NIL</a>) ... ))
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
<p>For example,</p>
|
<p>For example,</p>
|
||||||
|
|
||||||
<pre>
|
<pre>
|
||||||
<a href="list_transform.htm#BOOST_PP_LIST_TRANSFORM">BOOST_PP_LIST_TRANSFORM</a>(<a href="arithmetic_add.htm#BOOST_PP_ADD_D">BOOST_PP_ADD_D</a>,2,<a href="tuple_to_list.htm#BOOST_PP_TUPLE_TO_LIST">BOOST_PP_TUPLE_TO_LIST</a>(2,(1,2)))
|
<a href="list_transform.htm#BOOST_PP_LIST_TRANSFORM">BOOST_PP_LIST_TRANSFORM</a>(<a href="arithmetic_add.htm#BOOST_PP_ADD_D">BOOST_PP_ADD_D</a>,2,<a href="tuple_to_list.htm#BOOST_PP_TUPLE_TO_LIST">BOOST_PP_TUPLE_TO_LIST</a>(2,(1,2)))
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
<p>expands to the same as:</p>
|
<p>expands to the same as:</p>
|
||||||
|
|
||||||
<pre>
|
<pre>
|
||||||
<a href="tuple_to_list.htm#BOOST_PP_TUPLE_TO_LIST">BOOST_PP_TUPLE_TO_LIST</a>(2,(3,4))
|
<a href="tuple_to_list.htm#BOOST_PP_TUPLE_TO_LIST">BOOST_PP_TUPLE_TO_LIST</a>(2,(3,4))
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
<h3>Uses</h3>
|
<h3>Uses</h3>
|
||||||
|
@ -30,20 +30,20 @@
|
|||||||
<p>In other words, expands to the sequence:</p>
|
<p>In other words, expands to the sequence:</p>
|
||||||
|
|
||||||
<pre>
|
<pre>
|
||||||
MACRO(0,DATA) MACRO(1,DATA) ... MACRO(<a href="dec.htm#BOOST_PP_DEC">BOOST_PP_DEC</a>(COUNT),DATA)
|
MACRO(0,DATA) MACRO(1,DATA) ... MACRO(<a href="dec.htm#BOOST_PP_DEC">BOOST_PP_DEC</a>(COUNT),DATA)
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
<p>For example,</p>
|
<p>For example,</p>
|
||||||
|
|
||||||
<pre>
|
<pre>
|
||||||
#define TEST(INDEX,DATA) DATA(INDEX);
|
#define TEST(INDEX,DATA) DATA(INDEX);
|
||||||
<a href="repeat.htm#BOOST_PP_REPEAT">BOOST_PP_REPEAT</a>(3,TEST,X)
|
<a href="repeat.htm#BOOST_PP_REPEAT">BOOST_PP_REPEAT</a>(3,TEST,X)
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
<p>expands to:</p>
|
<p>expands to:</p>
|
||||||
|
|
||||||
<pre>
|
<pre>
|
||||||
X(0); X(1); X(2);
|
X(0); X(1); X(2);
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
<h3>2D and 3D repetition</h3>
|
<h3>2D and 3D repetition</h3>
|
||||||
|
@ -30,20 +30,20 @@
|
|||||||
<p>In other words, expands to the sequence:</p>
|
<p>In other words, expands to the sequence:</p>
|
||||||
|
|
||||||
<pre>
|
<pre>
|
||||||
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)
|
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>
|
</pre>
|
||||||
|
|
||||||
<p>For example,</p>
|
<p>For example,</p>
|
||||||
|
|
||||||
<pre>
|
<pre>
|
||||||
#define TEST(INDEX,DATA) DATA(INDEX);
|
#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)
|
<a href="repeat_from_to.htm#BOOST_PP_REPEAT_FROM_TO">BOOST_PP_REPEAT_FROM_TO</a>(4,7,TEST,X)
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
<p>expands to:</p>
|
<p>expands to:</p>
|
||||||
|
|
||||||
<pre>
|
<pre>
|
||||||
X(4); X(5); X(6);
|
X(4); X(5); X(6);
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
<h3>Uses</h3>
|
<h3>Uses</h3>
|
||||||
|
@ -34,9 +34,9 @@ constitutes a single macro parameter.</p>
|
|||||||
<p>Examples of tuples:</p>
|
<p>Examples of tuples:</p>
|
||||||
|
|
||||||
<pre>
|
<pre>
|
||||||
(const, volatile) // 2-tuple
|
(const, volatile) // 2-tuple
|
||||||
(*, /, %) // 3-tuple
|
(*, /, %) // 3-tuple
|
||||||
(1, "2", '3', (4,5)) // 4-tuple
|
(1, "2", '3', (4,5)) // 4-tuple
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
<p>Tuples can be used for representing structured data.</p>
|
<p>Tuples can be used for representing structured data.</p>
|
||||||
|
@ -33,7 +33,7 @@
|
|||||||
<p>For example,</p>
|
<p>For example,</p>
|
||||||
|
|
||||||
<pre>
|
<pre>
|
||||||
<a href="if.htm#BOOST_PP_IF">BOOST_PP_IF</a>(0,<a href="enum_params.htm#BOOST_PP_ENUM_PARAMS">BOOST_PP_ENUM_PARAMS</a>,<a href="tuple_eat.htm#BOOST_PP_TUPLE_EAT">BOOST_PP_TUPLE_EAT</a>(2))(10,P)
|
<a href="if.htm#BOOST_PP_IF">BOOST_PP_IF</a>(0,<a href="enum_params.htm#BOOST_PP_ENUM_PARAMS">BOOST_PP_ENUM_PARAMS</a>,<a href="tuple_eat.htm#BOOST_PP_TUPLE_EAT">BOOST_PP_TUPLE_EAT</a>(2))(10,P)
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
<p>expands to nothing.</p>
|
<p>expands to nothing.</p>
|
||||||
|
@ -30,7 +30,7 @@
|
|||||||
<p>For example,</p>
|
<p>For example,</p>
|
||||||
|
|
||||||
<pre>
|
<pre>
|
||||||
<a href="tuple_elem.htm#BOOST_PP_TUPLE_ELEM">BOOST_PP_TUPLE_ELEM</a>(2,1,(A,B))
|
<a href="tuple_elem.htm#BOOST_PP_TUPLE_ELEM">BOOST_PP_TUPLE_ELEM</a>(2,1,(A,B))
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
<p>expands to <code>B</code>.</p>
|
<p>expands to <code>B</code>.</p>
|
||||||
|
@ -30,7 +30,7 @@
|
|||||||
<p>For example,</p>
|
<p>For example,</p>
|
||||||
|
|
||||||
<pre>
|
<pre>
|
||||||
<a href="tuple_reverse.htm#BOOST_PP_TUPLE_REVERSE">BOOST_PP_TUPLE_REVERSE</a>(3,(A,B,C))
|
<a href="tuple_reverse.htm#BOOST_PP_TUPLE_REVERSE">BOOST_PP_TUPLE_REVERSE</a>(3,(A,B,C))
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
<p>expands to <code>(C,B,A)</code>.</p>
|
<p>expands to <code>(C,B,A)</code>.</p>
|
||||||
|
@ -30,16 +30,16 @@
|
|||||||
<p>For example,</p>
|
<p>For example,</p>
|
||||||
|
|
||||||
<pre>
|
<pre>
|
||||||
<a href="tuple_to_list.htm#BOOST_PP_TUPLE_TO_LIST">BOOST_PP_TUPLE_TO_LIST</a>(3,(A,B,C))
|
<a href="tuple_to_list.htm#BOOST_PP_TUPLE_TO_LIST">BOOST_PP_TUPLE_TO_LIST</a>(3,(A,B,C))
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
<p>expands to the same as</p>
|
<p>expands to the same as</p>
|
||||||
|
|
||||||
<pre>
|
<pre>
|
||||||
<a href="list_adt.htm#BOOST_PP_LIST_CONS">BOOST_PP_LIST_CONS</a>(A,
|
<a href="list_adt.htm#BOOST_PP_LIST_CONS">BOOST_PP_LIST_CONS</a>(A,
|
||||||
<a href="list_adt.htm#BOOST_PP_LIST_CONS">BOOST_PP_LIST_CONS</a>(B,
|
<a href="list_adt.htm#BOOST_PP_LIST_CONS">BOOST_PP_LIST_CONS</a>(B,
|
||||||
<a href="list_adt.htm#BOOST_PP_LIST_CONS">BOOST_PP_LIST_CONS</a>(C,
|
<a href="list_adt.htm#BOOST_PP_LIST_CONS">BOOST_PP_LIST_CONS</a>(C,
|
||||||
<a href="list_adt.htm#BOOST_PP_LIST_NIL">BOOST_PP_LIST_NIL</a>)))
|
<a href="list_adt.htm#BOOST_PP_LIST_NIL">BOOST_PP_LIST_NIL</a>)))
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
<h3>See</h3>
|
<h3>See</h3>
|
||||||
|
@ -30,7 +30,7 @@
|
|||||||
<p>In other words, expands to:</p>
|
<p>In other words, expands to:</p>
|
||||||
|
|
||||||
<pre>
|
<pre>
|
||||||
OP(D, ... OP(D, OP(D,STATE) ) ... )
|
OP(D, ... OP(D, OP(D,STATE) ) ... )
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
<p>The depth of iteration is determined by <code>PRED(D,STATE)</code>.</p>
|
<p>The depth of iteration is determined by <code>PRED(D,STATE)</code>.</p>
|
||||||
@ -38,15 +38,15 @@
|
|||||||
<p>For example,</p>
|
<p>For example,</p>
|
||||||
|
|
||||||
<pre>
|
<pre>
|
||||||
#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 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))
|
#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))
|
<a href="while.htm#BOOST_PP_WHILE">BOOST_PP_WHILE</a>(PRED,OP,(0,3))
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
<p>expands to:</p>
|
<p>expands to:</p>
|
||||||
|
|
||||||
<pre>
|
<pre>
|
||||||
(3,3)
|
(3,3)
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
<h3>Legend</h3>
|
<h3>Legend</h3>
|
||||||
|
@ -21,7 +21,7 @@ for separating macro parameters.</p>
|
|||||||
<p>For example,</p>
|
<p>For example,</p>
|
||||||
|
|
||||||
<pre>
|
<pre>
|
||||||
BOOST_PP_IF(1,BOOST_PP_COMMA,BOOST_PP_EMPTY)()
|
BOOST_PP_IF(1,BOOST_PP_COMMA,BOOST_PP_EMPTY)()
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
<p>expands to a comma.</p>
|
<p>expands to a comma.</p>
|
||||||
|
@ -18,7 +18,7 @@
|
|||||||
<p>For example,</p>
|
<p>For example,</p>
|
||||||
|
|
||||||
<pre>
|
<pre>
|
||||||
BOOST_PP_IF(0,BOOST_PP_COMMA,BOOST_PP_EMPTY)()
|
BOOST_PP_IF(0,BOOST_PP_COMMA,BOOST_PP_EMPTY)()
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
<p>expands to nothing.</p>
|
<p>expands to nothing.</p>
|
||||||
|
@ -22,21 +22,21 @@
|
|||||||
<p>In other words, expands to the sequence:</p>
|
<p>In other words, expands to the sequence:</p>
|
||||||
|
|
||||||
<pre>
|
<pre>
|
||||||
MACRO(0,DATA), MACRO(1,DATA), ..., MACRO(BOOST_PP_DEC(COUNT),DATA)
|
MACRO(0,DATA), MACRO(1,DATA), ..., MACRO(BOOST_PP_DEC(COUNT),DATA)
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
<p>For example,</p>
|
<p>For example,</p>
|
||||||
|
|
||||||
<pre>
|
<pre>
|
||||||
#define TYPED_PARAM(INDEX,DATA)\
|
#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_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))
|
BOOST_PP_ENUM(3,TYPED_PARAM,(X,x))
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
<p>expands to:</p>
|
<p>expands to:</p>
|
||||||
|
|
||||||
<pre>
|
<pre>
|
||||||
X0 x0, X1 x1, X2 x2
|
X0 x0, X1 x1, X2 x2
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
<h3>Uses</h3>
|
<h3>Uses</h3>
|
||||||
|
@ -21,19 +21,19 @@
|
|||||||
<p>In other words, expands to the sequence:</p>
|
<p>In other words, expands to the sequence:</p>
|
||||||
|
|
||||||
<pre>
|
<pre>
|
||||||
BOOST_PP_CAT(PARAM,0), BOOST_PP_CAT(PARAM,1), ..., BOOST_PP_CAT(PARAM,BOOST_PP_DEC(COUNT))
|
BOOST_PP_CAT(PARAM,0), BOOST_PP_CAT(PARAM,1), ..., BOOST_PP_CAT(PARAM,BOOST_PP_DEC(COUNT))
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
<p>For example,</p>
|
<p>For example,</p>
|
||||||
|
|
||||||
<pre>
|
<pre>
|
||||||
BOOST_PP_ENUM_PARAMS(3,x)
|
BOOST_PP_ENUM_PARAMS(3,x)
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
<p>expands to:</p>
|
<p>expands to:</p>
|
||||||
|
|
||||||
<pre>
|
<pre>
|
||||||
x0, x1, x2
|
x0, x1, x2
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
<h3>Uses</h3>
|
<h3>Uses</h3>
|
||||||
|
@ -21,22 +21,22 @@
|
|||||||
<p>In other words, expands to the sequence:</p>
|
<p>In other words, expands to the sequence:</p>
|
||||||
|
|
||||||
<pre>
|
<pre>
|
||||||
BOOST_PP_CAT(PARAM,0) = DEFAULT,
|
BOOST_PP_CAT(PARAM,0) = DEFAULT,
|
||||||
BOOST_PP_CAT(PARAM,1) = DEFAULT,
|
BOOST_PP_CAT(PARAM,1) = DEFAULT,
|
||||||
...,
|
...,
|
||||||
BOOST_PP_CAT(PARAM,BOOST_PP_DEC(COUNT)) = DEFAULT
|
BOOST_PP_CAT(PARAM,BOOST_PP_DEC(COUNT)) = DEFAULT
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
<p>For example,</p>
|
<p>For example,</p>
|
||||||
|
|
||||||
<pre>
|
<pre>
|
||||||
BOOST_PP_ENUM_PARAMS_WITH_A_DEFAULT(3,x,y)
|
BOOST_PP_ENUM_PARAMS_WITH_A_DEFAULT(3,x,y)
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
<p>expands to:</p>
|
<p>expands to:</p>
|
||||||
|
|
||||||
<pre>
|
<pre>
|
||||||
x0 = y, x1 = y, x2 = y
|
x0 = y, x1 = y, x2 = y
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
<h3>Uses</h3>
|
<h3>Uses</h3>
|
||||||
|
@ -21,22 +21,22 @@
|
|||||||
<p>In other words, expands to the sequence:</p>
|
<p>In other words, expands to the sequence:</p>
|
||||||
|
|
||||||
<pre>
|
<pre>
|
||||||
BOOST_PP_CAT(PARAM,0) = BOOST_PP_CAT(DEFAULT,0),
|
BOOST_PP_CAT(PARAM,0) = BOOST_PP_CAT(DEFAULT,0),
|
||||||
BOOST_PP_CAT(PARAM,1) = BOOST_PP_CAT(DEFAULT,1),
|
BOOST_PP_CAT(PARAM,1) = BOOST_PP_CAT(DEFAULT,1),
|
||||||
...,
|
...,
|
||||||
BOOST_PP_CAT(PARAM,BOOST_PP_DEC(COUNT)) = BOOST_PP_CAT(DEFAULT,BOOST_PP_DEC(COUNT))
|
BOOST_PP_CAT(PARAM,BOOST_PP_DEC(COUNT)) = BOOST_PP_CAT(DEFAULT,BOOST_PP_DEC(COUNT))
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
<p>For example,</p>
|
<p>For example,</p>
|
||||||
|
|
||||||
<pre>
|
<pre>
|
||||||
BOOST_PP_ENUM_PARAMS_WITH_DEFAULTS(3,x,y)
|
BOOST_PP_ENUM_PARAMS_WITH_DEFAULTS(3,x,y)
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
<p>expands to:</p>
|
<p>expands to:</p>
|
||||||
|
|
||||||
<pre>
|
<pre>
|
||||||
x0 = y0, x1 = y1, x2 = y2
|
x0 = y0, x1 = y1, x2 = y2
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
<h3>Uses</h3>
|
<h3>Uses</h3>
|
||||||
|
@ -22,21 +22,21 @@
|
|||||||
<p>In other words, expands to the sequence:</p>
|
<p>In other words, expands to the sequence:</p>
|
||||||
|
|
||||||
<pre>
|
<pre>
|
||||||
MACRO(1,DATA), MACRO(2,DATA), ..., MACRO(BOOST_PP_DEC(COUNT),DATA)
|
MACRO(1,DATA), MACRO(2,DATA), ..., MACRO(BOOST_PP_DEC(COUNT),DATA)
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
<p>For example,</p>
|
<p>For example,</p>
|
||||||
|
|
||||||
<pre>
|
<pre>
|
||||||
#define TYPED_PARAM(INDEX,DATA)\
|
#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_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))
|
BOOST_PP_ENUM_SHIFTED(3,TYPED_PARAM,(X,x))
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
<p>expands to:</p>
|
<p>expands to:</p>
|
||||||
|
|
||||||
<pre>
|
<pre>
|
||||||
X1 x1, X2 x2
|
X1 x1, X2 x2
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
<h3>Uses</h3>
|
<h3>Uses</h3>
|
||||||
|
@ -21,18 +21,18 @@
|
|||||||
<p>In other words, expands to the sequence:</p>
|
<p>In other words, expands to the sequence:</p>
|
||||||
|
|
||||||
<pre>
|
<pre>
|
||||||
BOOST_PP_CAT(PARAM,1), BOOST_PP_CAT(PARAM,2), ..., BOOST_PP_CAT(PARAM,BOOST_PP_DEC(COUNT))
|
BOOST_PP_CAT(PARAM,1), BOOST_PP_CAT(PARAM,2), ..., BOOST_PP_CAT(PARAM,BOOST_PP_DEC(COUNT))
|
||||||
</pre>
|
</pre>
|
||||||
<p>For example,</p>
|
<p>For example,</p>
|
||||||
|
|
||||||
<pre>
|
<pre>
|
||||||
BOOST_PP_ENUM_SHIFTED_PARAMS(3,x)
|
BOOST_PP_ENUM_SHIFTED_PARAMS(3,x)
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
<p>expands to:</p>
|
<p>expands to:</p>
|
||||||
|
|
||||||
<pre>
|
<pre>
|
||||||
x1, x2
|
x1, x2
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
<h3>Uses</h3>
|
<h3>Uses</h3>
|
||||||
|
@ -22,11 +22,11 @@
|
|||||||
<p>In other words, expands to the sequence:</p>
|
<p>In other words, expands to the sequence:</p>
|
||||||
|
|
||||||
<pre>
|
<pre>
|
||||||
MACRO(R,STATE)
|
MACRO(R,STATE)
|
||||||
MACRO(R,OP(R,STATE))
|
MACRO(R,OP(R,STATE))
|
||||||
MACRO(R,OP(R,OP(R,STATE)))
|
MACRO(R,OP(R,OP(R,STATE)))
|
||||||
...
|
...
|
||||||
MACRO(R,OP(R,OP(...OP(R,STATE)...)))
|
MACRO(R,OP(R,OP(...OP(R,STATE)...)))
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
<p>The length of the sequence is determined by <code>PRED(R,STATE)</code>.</p>
|
<p>The length of the sequence is determined by <code>PRED(R,STATE)</code>.</p>
|
||||||
@ -34,16 +34,16 @@
|
|||||||
<p>For example,</p>
|
<p>For example,</p>
|
||||||
|
|
||||||
<pre>
|
<pre>
|
||||||
#define PRED(R,STATE) BOOST_PP_LESS(BOOST_PP_TUPLE_ELEM(2,0,STATE),BOOST_PP_TUPLE_ELEM(2,1,STATE))
|
#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 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)
|
#define MACRO(R,STATE) BOOST_PP_TUPLE_ELEM(2,0,STATE)
|
||||||
BOOST_PP_FOR((0,3),PRED,OP,MACRO)
|
BOOST_PP_FOR((0,3),PRED,OP,MACRO)
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
<p>expands to:</p>
|
<p>expands to:</p>
|
||||||
|
|
||||||
<pre>
|
<pre>
|
||||||
0 1 2
|
0 1 2
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
<h3>Legend</h3>
|
<h3>Legend</h3>
|
||||||
|
@ -23,13 +23,13 @@ invoked.</p>
|
|||||||
<p>For example,</p>
|
<p>For example,</p>
|
||||||
|
|
||||||
<pre>
|
<pre>
|
||||||
BOOST_PP_IF(1,BOOST_PP_IDENTITY(X),BOOST_PP_EMPTY)<b>()</b>
|
BOOST_PP_IF(1,BOOST_PP_IDENTITY(X),BOOST_PP_EMPTY)<b>()</b>
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
<p>expands to:</p>
|
<p>expands to:</p>
|
||||||
|
|
||||||
<pre>
|
<pre>
|
||||||
X
|
X
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
<h3>Test</h3>
|
<h3>Test</h3>
|
||||||
|
@ -32,18 +32,18 @@
|
|||||||
BOOST_PP_LIST_CONS(). For example,</p>
|
BOOST_PP_LIST_CONS(). For example,</p>
|
||||||
|
|
||||||
<pre>
|
<pre>
|
||||||
BOOST_PP_LIST_CONS(1,
|
BOOST_PP_LIST_CONS(1,
|
||||||
BOOST_PP_LIST_CONS(2,
|
BOOST_PP_LIST_CONS(2,
|
||||||
BOOST_PP_LIST_CONS(3,
|
BOOST_PP_LIST_CONS(3,
|
||||||
BOOST_PP_LIST_CONS(4,
|
BOOST_PP_LIST_CONS(4,
|
||||||
BOOST_PP_LIST_CONS(5,
|
BOOST_PP_LIST_CONS(5,
|
||||||
BOOST_PP_LIST_NIL)))))
|
BOOST_PP_LIST_NIL)))))
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
<p>Short lists can also be build from tuples:</p>
|
<p>Short lists can also be build from tuples:</p>
|
||||||
|
|
||||||
<pre>
|
<pre>
|
||||||
BOOST_PP_TUPLE_TO_LIST(5,(1,2,3,4,5))
|
BOOST_PP_TUPLE_TO_LIST(5,(1,2,3,4,5))
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
<p>Both of the above lists contain 5 elements: 1, 2, 3, 4 and 5.</p>
|
<p>Both of the above lists contain 5 elements: 1, 2, 3, 4 and 5.</p>
|
||||||
@ -52,16 +52,16 @@ BOOST_PP_LIST_CONS(). For example,</p>
|
|||||||
and BOOST_PP_LIST_FOLD_RIGHT_2ND():</p>
|
and BOOST_PP_LIST_FOLD_RIGHT_2ND():</p>
|
||||||
|
|
||||||
<pre>
|
<pre>
|
||||||
BOOST_PP_LIST_FOLD_RIGHT_2ND
|
BOOST_PP_LIST_FOLD_RIGHT_2ND
|
||||||
( BOOST_PP_LIST_APPEND_D
|
( BOOST_PP_LIST_APPEND_D
|
||||||
, BOOST_PP_TUPLE_TO_LIST
|
, BOOST_PP_TUPLE_TO_LIST
|
||||||
( N
|
( N
|
||||||
, BOOST_PP_TUPLE_TO_LIST(M, (E11, E12, ..., E1M) )
|
, BOOST_PP_TUPLE_TO_LIST(M, (E11, E12, ..., E1M) )
|
||||||
, BOOST_PP_TUPLE_TO_LIST(M, (E21, E22, ..., E2M) )
|
, BOOST_PP_TUPLE_TO_LIST(M, (E21, E22, ..., E2M) )
|
||||||
, ...
|
, ...
|
||||||
, BOOST_PP_TUPLE_TO_LIST(M, (EN1, EN2, ..., ENM) )
|
, BOOST_PP_TUPLE_TO_LIST(M, (EN1, EN2, ..., ENM) )
|
||||||
)
|
|
||||||
)
|
)
|
||||||
|
)
|
||||||
</pre>
|
</pre>
|
||||||
*/
|
*/
|
||||||
#define BOOST_PP_LIST_CONS(FIRST,REST) (FIRST,REST,1)
|
#define BOOST_PP_LIST_CONS(FIRST,REST) (FIRST,REST,1)
|
||||||
@ -88,7 +88,7 @@ and BOOST_PP_LIST_FOLD_RIGHT_2ND():</p>
|
|||||||
<p>For example,</p>
|
<p>For example,</p>
|
||||||
|
|
||||||
<pre>
|
<pre>
|
||||||
BOOST_PP_LIST_FIRST(BOOST_PP_TUPLE_TO_LIST(5,(1,2,3,4,5)))
|
BOOST_PP_LIST_FIRST(BOOST_PP_TUPLE_TO_LIST(5,(1,2,3,4,5)))
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
<p>expands to 1.</p>
|
<p>expands to 1.</p>
|
||||||
@ -106,13 +106,13 @@ and BOOST_PP_LIST_FOLD_RIGHT_2ND():</p>
|
|||||||
<p>For example,</p>
|
<p>For example,</p>
|
||||||
|
|
||||||
<pre>
|
<pre>
|
||||||
BOOST_PP_LIST_REST(BOOST_PP_TUPLE_TO_LIST(5,(1,2,3,4,5)))
|
BOOST_PP_LIST_REST(BOOST_PP_TUPLE_TO_LIST(5,(1,2,3,4,5)))
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
<p>expands to the same as:</p>
|
<p>expands to the same as:</p>
|
||||||
|
|
||||||
<pre>
|
<pre>
|
||||||
BOOST_PP_TUPLE_TO_LIST(4,(2,3,4,5))
|
BOOST_PP_TUPLE_TO_LIST(4,(2,3,4,5))
|
||||||
</pre>
|
</pre>
|
||||||
*/
|
*/
|
||||||
#if !defined(BOOST_NO_COMPILER_CONFIG) && defined(__MWERKS__)
|
#if !defined(BOOST_NO_COMPILER_CONFIG) && defined(__MWERKS__)
|
||||||
|
@ -20,16 +20,16 @@
|
|||||||
<p>For example,</p>
|
<p>For example,</p>
|
||||||
|
|
||||||
<pre>
|
<pre>
|
||||||
BOOST_PP_LIST_APPEND
|
BOOST_PP_LIST_APPEND
|
||||||
( BOOST_PP_TUPLE_TO_LIST(2,(1,2))
|
( BOOST_PP_TUPLE_TO_LIST(2,(1,2))
|
||||||
, BOOST_PP_TUPLE_TO_LIST(2,(3,4))
|
, BOOST_PP_TUPLE_TO_LIST(2,(3,4))
|
||||||
)
|
)
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
<p>expands to the same as:</p>
|
<p>expands to the same as:</p>
|
||||||
|
|
||||||
<pre>
|
<pre>
|
||||||
BOOST_PP_TUPLE_TO_LIST(4,(1,2,3,4))
|
BOOST_PP_TUPLE_TO_LIST(4,(1,2,3,4))
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
<h3>Uses</h3>
|
<h3>Uses</h3>
|
||||||
|
@ -21,7 +21,7 @@ first element is at index <code>0</code>.</p>
|
|||||||
<p>For example,</p>
|
<p>For example,</p>
|
||||||
|
|
||||||
<pre>
|
<pre>
|
||||||
BOOST_PP_LIST_AT(BOOST_PP_TUPLE_TO_LIST(3,(A,B,C)),1)
|
BOOST_PP_LIST_AT(BOOST_PP_TUPLE_TO_LIST(3,(A,B,C)),1)
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
<p>expands to <code>B</code>.</p>
|
<p>expands to <code>B</code>.</p>
|
||||||
|
@ -21,13 +21,13 @@
|
|||||||
<p>For example,</p>
|
<p>For example,</p>
|
||||||
|
|
||||||
<pre>
|
<pre>
|
||||||
BOOST_PP_LIST_CAT(BOOST_PP_TUPLE_TO_LIST(3,(1,2,3)))
|
BOOST_PP_LIST_CAT(BOOST_PP_TUPLE_TO_LIST(3,(1,2,3)))
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
<p>expands to:</p>
|
<p>expands to:</p>
|
||||||
|
|
||||||
<pre>
|
<pre>
|
||||||
123
|
123
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
<h3>Uses</h3>
|
<h3>Uses</h3>
|
||||||
|
@ -21,13 +21,13 @@
|
|||||||
<p>For example,</p>
|
<p>For example,</p>
|
||||||
|
|
||||||
<pre>
|
<pre>
|
||||||
BOOST_PP_LIST_ENUM(BOOST_PP_TUPLE_TO_LIST(3,(A,B,C)))
|
BOOST_PP_LIST_ENUM(BOOST_PP_TUPLE_TO_LIST(3,(A,B,C)))
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
<p>expands to:</p>
|
<p>expands to:</p>
|
||||||
|
|
||||||
<pre>
|
<pre>
|
||||||
A,B,C
|
A,B,C
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
<h3>Uses</h3>
|
<h3>Uses</h3>
|
||||||
|
@ -21,13 +21,13 @@ for which <code>PRED(D,DATA,X)</code> is true.</p>
|
|||||||
<p>For example,</p>
|
<p>For example,</p>
|
||||||
|
|
||||||
<pre>
|
<pre>
|
||||||
BOOST_PP_LIST_FILTER(BOOST_PP_NOT_EQUAL_D,2,BOOST_PP_TUPLE_TO_LIST(3,(1,2,3)))
|
BOOST_PP_LIST_FILTER(BOOST_PP_NOT_EQUAL_D,2,BOOST_PP_TUPLE_TO_LIST(3,(1,2,3)))
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
<p>expands to the same as:</p>
|
<p>expands to the same as:</p>
|
||||||
|
|
||||||
<pre>
|
<pre>
|
||||||
BOOST_PP_TUPLE_TO_LIST(2,(1,3))
|
BOOST_PP_TUPLE_TO_LIST(2,(1,3))
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
<h3>Uses</h3>
|
<h3>Uses</h3>
|
||||||
|
@ -23,13 +23,13 @@
|
|||||||
<p>For example,</p>
|
<p>For example,</p>
|
||||||
|
|
||||||
<pre>
|
<pre>
|
||||||
BOOST_PP_LIST_FIRST_N(2,BOOST_PP_TUPLE_TO_LIST(4,(+,-,*,/)))
|
BOOST_PP_LIST_FIRST_N(2,BOOST_PP_TUPLE_TO_LIST(4,(+,-,*,/)))
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
<p>expands to the same as:</p>
|
<p>expands to the same as:</p>
|
||||||
|
|
||||||
<pre>
|
<pre>
|
||||||
BOOST_PP_TUPLE_TO_LIST(2,(+,-))
|
BOOST_PP_TUPLE_TO_LIST(2,(+,-))
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
<h3>See</h3>
|
<h3>See</h3>
|
||||||
|
@ -22,24 +22,24 @@ list <code>LIST</code> (from the left or the start of the list).</p>
|
|||||||
<p>In other words, expands to:</p>
|
<p>In other words, expands to:</p>
|
||||||
|
|
||||||
<pre>
|
<pre>
|
||||||
OP
|
OP
|
||||||
( D
|
( D
|
||||||
, ... OP(D, OP(D,STATE,BOOST_PP_LIST_AT(LIST,0)), BOOST_PP_LIST_AT(LIST,1)) ...
|
, ... 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))
|
, BOOST_PP_LIST_AT(LIST,BOOST_PP_DEC(BOOST_PP_LIST_SIZE(LIST))
|
||||||
)
|
)
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
<p>For example,</p>
|
<p>For example,</p>
|
||||||
|
|
||||||
<pre>
|
<pre>
|
||||||
#define TEST(D,STATE,X) BOOST_PP_CAT(STATE,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)))
|
BOOST_PP_LIST_FOLD_LEFT(TEST,_,BOOST_PP_TUPLE_TO_LIST(3,(A,B,C)))
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
<p>expands to:</p>
|
<p>expands to:</p>
|
||||||
|
|
||||||
<pre>
|
<pre>
|
||||||
_ABC
|
_ABC
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
<h3>Note</h3>
|
<h3>Note</h3>
|
||||||
|
@ -21,32 +21,32 @@ list <code>LIST</code> (from the right or the end of the list).</p>
|
|||||||
<p>In other words, expands to:</p>
|
<p>In other words, expands to:</p>
|
||||||
|
|
||||||
<pre>
|
<pre>
|
||||||
OP
|
OP
|
||||||
( D
|
( D
|
||||||
, BOOST_PP_LIST_AT(LIST,0)
|
, BOOST_PP_LIST_AT(LIST,0)
|
||||||
, ... OP
|
, ... OP
|
||||||
|
( D
|
||||||
|
, BOOST_PP_LIST_AT(LIST,BOOST_PP_SUB(BOOST_PP_LIST_SIZE(LIST),2))
|
||||||
|
, OP
|
||||||
( D
|
( D
|
||||||
, BOOST_PP_LIST_AT(LIST,BOOST_PP_SUB(BOOST_PP_LIST_SIZE(LIST),2))
|
, BOOST_PP_LIST_AT(LIST,BOOST_PP_SUB(BOOST_PP_LIST_SIZE(LIST),1))
|
||||||
, OP
|
, STATE
|
||||||
( D
|
)
|
||||||
, BOOST_PP_LIST_AT(LIST,BOOST_PP_SUB(BOOST_PP_LIST_SIZE(LIST),1))
|
) ...
|
||||||
, STATE
|
)
|
||||||
)
|
|
||||||
) ...
|
|
||||||
)
|
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
<p>For example,</p>
|
<p>For example,</p>
|
||||||
|
|
||||||
<pre>
|
<pre>
|
||||||
#define TEST(D,X,STATE) BOOST_PP_CAT(STATE,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)))
|
BOOST_PP_LIST_FOLD_RIGHT(TEST,_,BOOST_PP_TUPLE_TO_LIST(3,(A,B,C)))
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
<p>expands to:</p>
|
<p>expands to:</p>
|
||||||
|
|
||||||
<pre>
|
<pre>
|
||||||
_CBA
|
_CBA
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
<h3>Uses</h3>
|
<h3>Uses</h3>
|
||||||
|
@ -21,23 +21,23 @@ BOOST_PP_LIST_SIZE(LIST)).</p>
|
|||||||
<p>In other words, expands to the sequence:</p>
|
<p>In other words, expands to the sequence:</p>
|
||||||
|
|
||||||
<pre>
|
<pre>
|
||||||
MACRO(R,DATA,BOOST_PP_LIST_AT(LIST,0))
|
MACRO(R,DATA,BOOST_PP_LIST_AT(LIST,0))
|
||||||
MACRO(R,DATA,BOOST_PP_LIST_AT(LIST,1))
|
MACRO(R,DATA,BOOST_PP_LIST_AT(LIST,1))
|
||||||
...
|
...
|
||||||
MACRO(R,DATA,BOOST_PP_LIST_AT(LIST,BOOST_PP_DEC(BOOST_PP_LIST_SIZE(LIST))))
|
MACRO(R,DATA,BOOST_PP_LIST_AT(LIST,BOOST_PP_DEC(BOOST_PP_LIST_SIZE(LIST))))
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
<p>For example,</p>
|
<p>For example,</p>
|
||||||
|
|
||||||
<pre>
|
<pre>
|
||||||
#define TEST(R,DATA,X) BOOST_PP_CAT(DATA,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)))
|
BOOST_PP_LIST_FOR_EACH(TEST,prefix_,BOOST_PP_TUPLE_TO_LIST(3,(A,B,C)))
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
<p>expands to:</p>
|
<p>expands to:</p>
|
||||||
|
|
||||||
<pre>
|
<pre>
|
||||||
prefix_A(); prefix_B(); prefix_C();
|
prefix_A(); prefix_B(); prefix_C();
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
<h3>Example</h3>
|
<h3>Example</h3>
|
||||||
|
@ -23,23 +23,23 @@ BOOST_PP_LIST_SIZE(LIST)).</p>
|
|||||||
<p>In other words, expands to the sequence:</p>
|
<p>In other words, expands to the sequence:</p>
|
||||||
|
|
||||||
<pre>
|
<pre>
|
||||||
MACRO(R,DATA,0,BOOST_PP_LIST_AT(LIST,0))
|
MACRO(R,DATA,0,BOOST_PP_LIST_AT(LIST,0))
|
||||||
MACRO(R,DATA,1,BOOST_PP_LIST_AT(LIST,1))
|
MACRO(R,DATA,1,BOOST_PP_LIST_AT(LIST,1))
|
||||||
...
|
...
|
||||||
MACRO(R,DATA,BOOST_PP_DEC(BOOST_PP_LIST_SIZE(LIST)),BOOST_PP_LIST_AT(LIST,BOOST_PP_DEC(BOOST_PP_LIST_SIZE(LIST))))
|
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>
|
</pre>
|
||||||
|
|
||||||
<p>For example,</p>
|
<p>For example,</p>
|
||||||
|
|
||||||
<pre>
|
<pre>
|
||||||
#define TEST(R,DATA,INDEX,X) BOOST_PP_CAT(DATA,X)(INDEX);
|
#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)))
|
BOOST_PP_LIST_FOR_EACH_I(TEST,prefix_,BOOST_PP_TUPLE_TO_LIST(3,(A,B,C)))
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
<p>expands to:</p>
|
<p>expands to:</p>
|
||||||
|
|
||||||
<pre>
|
<pre>
|
||||||
prefix_A(0); prefix_B(1); prefix_C(2);
|
prefix_A(0); prefix_B(1); prefix_C(2);
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
<h3>Uses</h3>
|
<h3>Uses</h3>
|
||||||
|
@ -28,20 +28,20 @@ explosion.</p>
|
|||||||
<p>For example,</p>
|
<p>For example,</p>
|
||||||
|
|
||||||
<pre>
|
<pre>
|
||||||
#define TEST(R,X) X
|
#define TEST(R,X) X
|
||||||
BOOST_PP_LIST_FOR_EACH_PRODUCT
|
BOOST_PP_LIST_FOR_EACH_PRODUCT
|
||||||
( TEST
|
( TEST
|
||||||
, 2
|
, 2
|
||||||
, ( BOOST_PP_TUPLE_TO_LIST(3,(A,B,C))
|
, ( BOOST_PP_TUPLE_TO_LIST(3,(A,B,C))
|
||||||
, BOOST_PP_TUPLE_TO_LIST(2,(1,2))
|
, BOOST_PP_TUPLE_TO_LIST(2,(1,2))
|
||||||
)
|
|
||||||
)
|
)
|
||||||
|
)
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
<p>expands to:</p>
|
<p>expands to:</p>
|
||||||
|
|
||||||
<pre>
|
<pre>
|
||||||
(A,1) (A,2) (B,1) (B,2) (C,1) (C,2)
|
(A,1) (A,2) (B,1) (B,2) (C,1) (C,2)
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
<h3>Example</h3>
|
<h3>Example</h3>
|
||||||
|
@ -23,13 +23,13 @@ list <code>LIST</code>.</p>
|
|||||||
<p>For example,</p>
|
<p>For example,</p>
|
||||||
|
|
||||||
<pre>
|
<pre>
|
||||||
BOOST_PP_LIST_REST_N(2,BOOST_PP_TUPLE_TO_LIST(4,(+,-,*,/)))
|
BOOST_PP_LIST_REST_N(2,BOOST_PP_TUPLE_TO_LIST(4,(+,-,*,/)))
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
<p>expands to the same as:</p>
|
<p>expands to the same as:</p>
|
||||||
|
|
||||||
<pre>
|
<pre>
|
||||||
BOOST_PP_TUPLE_TO_LIST(2,(*,/))
|
BOOST_PP_TUPLE_TO_LIST(2,(*,/))
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
<h3>See</h3>
|
<h3>See</h3>
|
||||||
|
@ -20,13 +20,13 @@
|
|||||||
<p>For example,</p>
|
<p>For example,</p>
|
||||||
|
|
||||||
<pre>
|
<pre>
|
||||||
BOOST_PP_LIST_REVERSE(BOOST_PP_TUPLE_TO_LIST(3,(A,B,C)))
|
BOOST_PP_LIST_REVERSE(BOOST_PP_TUPLE_TO_LIST(3,(A,B,C)))
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
<p>expands to the same as:</p>
|
<p>expands to the same as:</p>
|
||||||
|
|
||||||
<pre>
|
<pre>
|
||||||
BOOST_PP_TUPLE_TO_LIST(3,(C,B,A))
|
BOOST_PP_TUPLE_TO_LIST(3,(C,B,A))
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
<h3>Uses</h3>
|
<h3>Uses</h3>
|
||||||
|
@ -21,7 +21,7 @@
|
|||||||
<p>For example,</p>
|
<p>For example,</p>
|
||||||
|
|
||||||
<pre>
|
<pre>
|
||||||
BOOST_PP_LIST_SIZE(BOOST_PP_TUPLE_TO_LIST(3,(A,B,C)))
|
BOOST_PP_LIST_SIZE(BOOST_PP_TUPLE_TO_LIST(3,(A,B,C)))
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
<p>expands to <code>3</code>.</p>
|
<p>expands to <code>3</code>.</p>
|
||||||
|
@ -20,7 +20,7 @@
|
|||||||
<p>For example,</p>
|
<p>For example,</p>
|
||||||
|
|
||||||
<pre>
|
<pre>
|
||||||
BOOST_PP_LIST_TO_TUPLE(BOOST_PP_TUPLE_TO_LIST(3,(A,B,C)))
|
BOOST_PP_LIST_TO_TUPLE(BOOST_PP_TUPLE_TO_LIST(3,(A,B,C)))
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
<p>expands to <code>(A,B,C)</code>.</p>
|
<p>expands to <code>(A,B,C)</code>.</p>
|
||||||
|
@ -21,23 +21,23 @@ of the list producing a new list.</p>
|
|||||||
<p>In other words, expands to:</p>
|
<p>In other words, expands to:</p>
|
||||||
|
|
||||||
<pre>
|
<pre>
|
||||||
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,0)),
|
||||||
BOOST_PP_LIST_CONS(OP(D,DATA,BOOST_PP_LIST_AT(LIST,1)),
|
BOOST_PP_LIST_CONS(OP(D,DATA,BOOST_PP_LIST_AT(LIST,1)),
|
||||||
...
|
...
|
||||||
BOOST_PP_LIST_CONS(OP(D,DATA,BOOST_PP_LIST_AT(LIST,BOOST_PP_DEC(BOOST_PP_LIST_SIZE(LIST)))),
|
BOOST_PP_LIST_CONS(OP(D,DATA,BOOST_PP_LIST_AT(LIST,BOOST_PP_DEC(BOOST_PP_LIST_SIZE(LIST)))),
|
||||||
BOOST_PP_LIST_NIL) ... ))
|
BOOST_PP_LIST_NIL) ... ))
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
<p>For example,</p>
|
<p>For example,</p>
|
||||||
|
|
||||||
<pre>
|
<pre>
|
||||||
BOOST_PP_LIST_TRANSFORM(BOOST_PP_ADD_D,2,BOOST_PP_TUPLE_TO_LIST(2,(1,2)))
|
BOOST_PP_LIST_TRANSFORM(BOOST_PP_ADD_D,2,BOOST_PP_TUPLE_TO_LIST(2,(1,2)))
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
<p>expands to the same as:</p>
|
<p>expands to the same as:</p>
|
||||||
|
|
||||||
<pre>
|
<pre>
|
||||||
BOOST_PP_TUPLE_TO_LIST(2,(3,4))
|
BOOST_PP_TUPLE_TO_LIST(2,(3,4))
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
<h3>Uses</h3>
|
<h3>Uses</h3>
|
||||||
|
@ -18,20 +18,20 @@
|
|||||||
<p>In other words, expands to the sequence:</p>
|
<p>In other words, expands to the sequence:</p>
|
||||||
|
|
||||||
<pre>
|
<pre>
|
||||||
MACRO(0,DATA) MACRO(1,DATA) ... MACRO(BOOST_PP_DEC(COUNT),DATA)
|
MACRO(0,DATA) MACRO(1,DATA) ... MACRO(BOOST_PP_DEC(COUNT),DATA)
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
<p>For example,</p>
|
<p>For example,</p>
|
||||||
|
|
||||||
<pre>
|
<pre>
|
||||||
#define TEST(INDEX,DATA) DATA(INDEX);
|
#define TEST(INDEX,DATA) DATA(INDEX);
|
||||||
BOOST_PP_REPEAT(3,TEST,X)
|
BOOST_PP_REPEAT(3,TEST,X)
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
<p>expands to:</p>
|
<p>expands to:</p>
|
||||||
|
|
||||||
<pre>
|
<pre>
|
||||||
X(0); X(1); X(2);
|
X(0); X(1); X(2);
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
<h3>2D and 3D repetition</h3>
|
<h3>2D and 3D repetition</h3>
|
||||||
|
@ -22,20 +22,20 @@
|
|||||||
<p>In other words, expands to the sequence:</p>
|
<p>In other words, expands to the sequence:</p>
|
||||||
|
|
||||||
<pre>
|
<pre>
|
||||||
MACRO(FIRST,DATA) MACRO(BOOST_PP_INC(FIRST),DATA) ... MACRO(BOOST_PP_DEC(LAST),DATA)
|
MACRO(FIRST,DATA) MACRO(BOOST_PP_INC(FIRST),DATA) ... MACRO(BOOST_PP_DEC(LAST),DATA)
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
<p>For example,</p>
|
<p>For example,</p>
|
||||||
|
|
||||||
<pre>
|
<pre>
|
||||||
#define TEST(INDEX,DATA) DATA(INDEX);
|
#define TEST(INDEX,DATA) DATA(INDEX);
|
||||||
BOOST_PP_REPEAT_FROM_TO(4,7,TEST,X)
|
BOOST_PP_REPEAT_FROM_TO(4,7,TEST,X)
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
<p>expands to:</p>
|
<p>expands to:</p>
|
||||||
|
|
||||||
<pre>
|
<pre>
|
||||||
X(4); X(5); X(6);
|
X(4); X(5); X(6);
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
<h3>Uses</h3>
|
<h3>Uses</h3>
|
||||||
|
@ -24,9 +24,9 @@ constitutes a single macro parameter.</p>
|
|||||||
<p>Examples of tuples:</p>
|
<p>Examples of tuples:</p>
|
||||||
|
|
||||||
<pre>
|
<pre>
|
||||||
(const, volatile) // 2-tuple
|
(const, volatile) // 2-tuple
|
||||||
(*, /, %) // 3-tuple
|
(*, /, %) // 3-tuple
|
||||||
(1, "2", '3', (4,5)) // 4-tuple
|
(1, "2", '3', (4,5)) // 4-tuple
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
<p>Tuples can be used for representing structured data.</p>
|
<p>Tuples can be used for representing structured data.</p>
|
||||||
|
@ -21,7 +21,7 @@ BOOST_PP_EMPTY().</p>
|
|||||||
<p>For example,</p>
|
<p>For example,</p>
|
||||||
|
|
||||||
<pre>
|
<pre>
|
||||||
BOOST_PP_IF(0,BOOST_PP_ENUM_PARAMS,BOOST_PP_TUPLE_EAT(2))(10,P)
|
BOOST_PP_IF(0,BOOST_PP_ENUM_PARAMS,BOOST_PP_TUPLE_EAT(2))(10,P)
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
<p>expands to nothing.</p>
|
<p>expands to nothing.</p>
|
||||||
|
@ -18,7 +18,7 @@
|
|||||||
<p>For example,</p>
|
<p>For example,</p>
|
||||||
|
|
||||||
<pre>
|
<pre>
|
||||||
BOOST_PP_TUPLE_ELEM(2,1,(A,B))
|
BOOST_PP_TUPLE_ELEM(2,1,(A,B))
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
<p>expands to <code>B</code>.</p>
|
<p>expands to <code>B</code>.</p>
|
||||||
|
@ -18,7 +18,7 @@
|
|||||||
<p>For example,</p>
|
<p>For example,</p>
|
||||||
|
|
||||||
<pre>
|
<pre>
|
||||||
BOOST_PP_TUPLE_REVERSE(3,(A,B,C))
|
BOOST_PP_TUPLE_REVERSE(3,(A,B,C))
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
<p>expands to <code>(C,B,A)</code>.</p>
|
<p>expands to <code>(C,B,A)</code>.</p>
|
||||||
|
@ -20,16 +20,16 @@
|
|||||||
<p>For example,</p>
|
<p>For example,</p>
|
||||||
|
|
||||||
<pre>
|
<pre>
|
||||||
BOOST_PP_TUPLE_TO_LIST(3,(A,B,C))
|
BOOST_PP_TUPLE_TO_LIST(3,(A,B,C))
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
<p>expands to the same as</p>
|
<p>expands to the same as</p>
|
||||||
|
|
||||||
<pre>
|
<pre>
|
||||||
BOOST_PP_LIST_CONS(A,
|
BOOST_PP_LIST_CONS(A,
|
||||||
BOOST_PP_LIST_CONS(B,
|
BOOST_PP_LIST_CONS(B,
|
||||||
BOOST_PP_LIST_CONS(C,
|
BOOST_PP_LIST_CONS(C,
|
||||||
BOOST_PP_LIST_NIL)))
|
BOOST_PP_LIST_NIL)))
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
<h3>See</h3>
|
<h3>See</h3>
|
||||||
|
@ -21,7 +21,7 @@
|
|||||||
<p>In other words, expands to:</p>
|
<p>In other words, expands to:</p>
|
||||||
|
|
||||||
<pre>
|
<pre>
|
||||||
OP(D, ... OP(D, OP(D,STATE) ) ... )
|
OP(D, ... OP(D, OP(D,STATE) ) ... )
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
<p>The depth of iteration is determined by <code>PRED(D,STATE)</code>.</p>
|
<p>The depth of iteration is determined by <code>PRED(D,STATE)</code>.</p>
|
||||||
@ -29,15 +29,15 @@
|
|||||||
<p>For example,</p>
|
<p>For example,</p>
|
||||||
|
|
||||||
<pre>
|
<pre>
|
||||||
#define PRED(D,STATE) BOOST_PP_LESS_D(D,BOOST_PP_TUPLE_ELEM(2,0,STATE),BOOST_PP_TUPLE_ELEM(2,1,STATE))
|
#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))
|
#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))
|
BOOST_PP_WHILE(PRED,OP,(0,3))
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
<p>expands to:</p>
|
<p>expands to:</p>
|
||||||
|
|
||||||
<pre>
|
<pre>
|
||||||
(3,3)
|
(3,3)
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
<h3>Legend</h3>
|
<h3>Legend</h3>
|
||||||
|
Reference in New Issue
Block a user