Compare commits

...

36 Commits

Author SHA1 Message Date
32116d3705 This commit was manufactured by cvs2svn to create tag
'Version_1_28_0'.

[SVN r13949]
2002-05-16 13:26:18 +00:00
dc65bdeb3b This commit was manufactured by cvs2svn to create branch 'RC_1_28_0'.
[SVN r13795]
2002-05-10 04:34:27 +00:00
bf45543e2f Minor optimization
[SVN r13552]
2002-04-23 15:17:27 +00:00
aa738488be Minor optimization on BOOST_PP_TUPLE_ELEM()
[SVN r13550]
2002-04-23 14:56:38 +00:00
bfd89be28b Renamed 1 character parameter names
[SVN r13549]
2002-04-23 13:52:36 +00:00
b899890a46 Renamed 1 character parameter names
[SVN r13548]
2002-04-23 12:55:48 +00:00
34c788f3a0 Changed syntax of half-open range
[SVN r13491]
2002-04-15 06:49:49 +00:00
19962553a5 Removed obsolete functions from the reference.
[SVN r13474]
2002-04-13 11:14:50 +00:00
336749e0ae Added requirements on numeric parameters
[SVN r13460]
2002-04-12 12:16:05 +00:00
06ff87a86c Longer macro parameter names
[SVN r13459]
2002-04-12 11:26:25 +00:00
3468956bc9 Added FROM_TO repetition macros.
[SVN r13364]
2002-04-04 08:23:26 +00:00
acb748ed77 Removed plan
[SVN r13177]
2002-03-11 20:16:24 +00:00
fcd4b15cdf Renamed BOOST_PP_IF_THEN to BOOST_PP_EXPR_IF
[SVN r13173]
2002-03-11 16:11:34 +00:00
a3e207e706 Docs updated
[SVN r13170]
2002-03-10 15:15:41 +00:00
03b37c307f Docs updated
[SVN r13169]
2002-03-10 12:31:37 +00:00
7202e6b56e Removed MWCW version number test from workarounds
[SVN r13166]
2002-03-10 08:27:13 +00:00
1ad72e98a9 Docs update
[SVN r13144]
2002-03-09 13:55:00 +00:00
da66351f86 Docs updates
[SVN r13142]
2002-03-09 08:57:33 +00:00
140a30f6f4 Fixed off-by-one error in documentation
[SVN r13129]
2002-03-08 13:27:37 +00:00
717666e5d4 Added BOOST_PP_IF_THEN
[SVN r13127]
2002-03-08 07:30:26 +00:00
7980b6e377 Added a link page to the examples
[SVN r13126]
2002-03-08 06:18:57 +00:00
2b9fee0cff How to make longer lists
[SVN r13037]
2002-03-03 08:39:30 +00:00
0b714a0ce7 Fixed embarrassing bug at N=0
[SVN r12951]
2002-02-27 07:42:00 +00:00
8a557b560b Added Duff's Device example
[SVN r12949]
2002-02-27 05:54:07 +00:00
2fc11e125a Added BOOST_PP_LIST_FOR_EACH_I
[SVN r12928]
2002-02-24 19:57:25 +00:00
045d40e5a6 Added BOOST_PP_LIST_FOLD_LEFT_2ND and BOOST_PP_LIST_FOLD_RIGHT_2ND
[SVN r12927]
2002-02-24 07:52:50 +00:00
23a1e16489 Some doc updates
[SVN r12926]
2002-02-24 07:45:22 +00:00
5fa1ddda5a Added ???_R and ???_D macros to reference
[SVN r12910]
2002-02-23 10:50:32 +00:00
dba7ae68c7 Added ???_D and ???_R names
[SVN r12909]
2002-02-23 10:28:28 +00:00
0681e43c79 Doxygen is out
[SVN r12908]
2002-02-23 10:26:09 +00:00
324604edce Added BOOST_PP_LIST_FOLD_LEFT_2ND and BOOST_PP_LIST_FOLD_RIGHT_2ND
[SVN r12897]
2002-02-22 12:48:27 +00:00
4834a1927b Added BOOST_PP_FOLD_RIGHT_2ND
[SVN r12896]
2002-02-22 11:03:40 +00:00
ffef0494ce Added BOOST_PP_FOLD_LEFT_2ND
[SVN r12895]
2002-02-22 10:40:34 +00:00
86be4492a3 Added BOOST_PP_FOLD_LEFT_2ND()
[SVN r12894]
2002-02-22 10:38:40 +00:00
6229f991c8 Added timestamp
[SVN r12893]
2002-02-22 07:39:56 +00:00
4c6d309384 MWCW workaround
[SVN r12760]
2002-02-08 16:54:43 +00:00
150 changed files with 2830 additions and 1453 deletions

90
doc/examples.htm Normal file
View File

@ -0,0 +1,90 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Boost.Preprocessor - Bibliography</title>
</head>
<body bgcolor="#FFFFFF" link="#0000ff" vlink="#800080">
<table border="0" cellpadding="7" cellspacing="0" width="100%" summary=
"header">
<tr>
<td valign="top" width="300">
<h3><a href="../../../index.htm"><img height="86" width="277" alt="C++ Boost" src="../../../c++boost.gif" border="0"></a></h3>
</td>
<td valign="top">
<h1 align="center">Boost.Preprocessor</h1>
<h2 align="center">Examples</h2>
</td>
</tr>
</table>
<hr>
<table>
<tr><td><a href="../example/array_arithmetic.c">array_arithmetic.c</a></td><td>This example implements over 2200 functions for 1-dimensional arithmetic
array manipulation in C. The idea is to use preprocessor data structures,
lists and tuples, for storing metainformation to be used for generating
the actual C code.</td></tr>
<tr>
<td><a href="../example/catch_builtin.cpp">catch_builtin.cpp</a></td>
<td>This example demonstrates the usage of lists and BOOST_PP_LIST_FOR_EACH().</td>
</tr>
<tr>
<td><a href="../example/count_down.c">count_down.c</a></td>
<td> This is a trivial example of using BOOST_PP_WHILE() that simply counts
down from N to 0 ultimately expanding to a 0.</td>
</tr>
<tr>
<td><a href="../example/delay.c">delay.c</a></td>
<td>This example implements a macro whose expansion takes exponential amount
of time.</td>
</tr>
<tr>
<td><a href="../example/duffs_device.c">duffs_device.c</a></td>
<td>This example uses the preprocessor library to implement a generalized
macro for implementing a Duff's Device.</td>
</tr>
<tr>
<td><a href="../example/is_integral.cpp">is_integral.cpp</a></td>
<td>This example demonstrates the usage of preprocessor lists for generating
C++ code.</td>
</tr>
<tr>
<td><a href="../example/linear_fib.c">linear_fib.c</a></td>
<td>This example shows how BOOST_PP_WHILE() can be used for implementing macros.</td>
</tr>
<tr>
<td><a href="../example/note.c">note.c</a></td>
<td>This example shows how BOOST_PP_STRINGIZE() can be used to allow macro
expansion before stringization.</td>
</tr>
<tr>
<td><a href="../example/repeat_2d.c">repeat_2d.c</a></td>
<td>This example implements a generalized macro for 2D repetition using the
simple repetition primitives of the preprocessor library.</td>
</tr>
<tr>
<td><a href="../example/static_assert.c">static_assert.c</a></td>
<td>This example shows how BOOST_PP_CAT() can be used to allow macro expansion
before token concatenation.</td>
</tr>
<tr>
<td><a href="../example/subscript_layer.cpp">subscript_layer.cpp</a></td>
<td>This example shows how BOOST_PP_EMPTY can be used as an unused or empty
parameter.</td>
</tr>
</table>
<hr>
<p>Revised
<!--webbot bot="Timestamp" S-Type="EDITED" S-Format="%d %B, %Y" startspan -->
<!--webbot bot="Timestamp" endspan i-checksum="39359" -->
</p>
<p><i>&copy; Copyright <a href="http://www.housemarque.com">Housemarque Oy</a> 2002</i></p>
<p><i>Permission to copy, use, modify, sell and distribute this document is granted
provided this copyright notice appears in all copies. This document is provided
"as is" without express or implied warranty, and with no claim as to its suitability
for any purpose.</i></p>
</body>
</html>

View File

@ -22,6 +22,7 @@
<h2>Contents</h2>
<dl>
<dt><a href="tutorial.htm">Tutorial</a></dt>
<dt><a href="examples.htm">Examples</a></dt>
<dt><a href="reference/index.htm">Reference</a></dt>
<dt><a href="known_problems_with_cpp.htm">Widely known problems with the C preprocessor</a></dt>
<dt><a href="keywords.txt">Keywords for syntax highlighting</a></dt>
@ -31,6 +32,11 @@
</dl>
<hr>
<p>Revised
<!--webbot bot="Timestamp" S-Type="EDITED" S-Format="%d %B, %Y" startspan --><!--webbot bot="Timestamp" endspan i-checksum="39359" -->
</p>
<p><i>&copy; Copyright <a href="http://www.housemarque.com">Housemarque Oy</a> 2002</i></p>
<p><i>Permission to copy, use, modify, sell and distribute this document is granted

View File

@ -1,4 +1,5 @@
BOOST_PP_ADD
BOOST_PP_ADD_D
BOOST_PP_AND
BOOST_PP_ASSERT_MSG
BOOST_PP_BOOL
@ -7,6 +8,7 @@ BOOST_PP_COMMA
BOOST_PP_COMMA_IF
BOOST_PP_DEC
BOOST_PP_DIV
BOOST_PP_DIV_D
BOOST_PP_EMPTY
BOOST_PP_ENUM
BOOST_PP_ENUM_PARAMS
@ -15,52 +17,88 @@ BOOST_PP_ENUM_PARAMS_WITH_DEFAULTS
BOOST_PP_ENUM_SHIFTED
BOOST_PP_ENUM_SHIFTED_PARAMS
BOOST_PP_EQUAL
BOOST_PP_EQUAL_D
BOOST_PP_EXPAND
BOOST_PP_EXPR_IF
BOOST_PP_FOR
BOOST_PP_GREATER
BOOST_PP_GREATER_D
BOOST_PP_GREATER_EQUAL
BOOST_PP_GREATER_EQUAL_D
BOOST_PP_IDENTITY
BOOST_PP_IF
BOOST_PP_INC
BOOST_PP_LESS
BOOST_PP_LESS_D
BOOST_PP_LESS_EQUAL
BOOST_PP_LESS_EQUAL_D
BOOST_PP_LIMIT_DIM
BOOST_PP_LIMIT_MAG
BOOST_PP_LIMIT_TUPLE
BOOST_PP_LIST_APPEND
BOOST_PP_LIST_APPEND_D
BOOST_PP_LIST_AT
BOOST_PP_LIST_AT_D
BOOST_PP_LIST_CAT
BOOST_PP_LIST_CAT_D
BOOST_PP_LIST_CONS
BOOST_PP_LIST_ENUM
BOOST_PP_LIST_ENUM_R
BOOST_PP_LIST_FILTER
BOOST_PP_LIST_FILTER_D
BOOST_PP_LIST_FIRST
BOOST_PP_LIST_FIRST_N
BOOST_PP_LIST_FIRST_N_D
BOOST_PP_LIST_FOLD_LEFT
BOOST_PP_LIST_FOLD_LEFT_D
BOOST_PP_LIST_FOLD_LEFT_2ND
BOOST_PP_LIST_FOLD_LEFT_2ND_D
BOOST_PP_LIST_FOLD_RIGHT
BOOST_PP_LIST_FOLD_RIGHT_D
BOOST_PP_LIST_FOLD_RIGHT_2ND
BOOST_PP_LIST_FOLD_RIGHT_2ND_D
BOOST_PP_LIST_FOR_EACH
BOOST_PP_LIST_FOR_EACH_I
BOOST_PP_LIST_FOR_EACH_I_R
BOOST_PP_LIST_FOR_EACH_R
BOOST_PP_LIST_FOR_EACH_PRODUCT
BOOST_PP_LIST_FOR_EACH_PRODUCT_R
BOOST_PP_LIST_IS_CONS
BOOST_PP_LIST_IS_NIL
BOOST_PP_LIST_NIL
BOOST_PP_LIST_REST
BOOST_PP_LIST_REST_N
BOOST_PP_LIST_REST_N_D
BOOST_PP_LIST_REVERSE
BOOST_PP_LIST_REVERSE_D
BOOST_PP_LIST_SIZE
BOOST_PP_LIST_SIZE_D
BOOST_PP_LIST_TO_TUPLE
BOOST_PP_LIST_TO_TUPLE_R
BOOST_PP_LIST_TRANSFORM
BOOST_PP_LIST_TRANSFORM_D
BOOST_PP_MAX
BOOST_PP_MAX_D
BOOST_PP_MIN
BOOST_PP_MIN_D
BOOST_PP_MOD
BOOST_PP_MOD_D
BOOST_PP_MUL
BOOST_PP_MUL_D
BOOST_PP_NOR
BOOST_PP_NOT
BOOST_PP_NOT_EQUAL
BOOST_PP_NOT_EQUAL_D
BOOST_PP_OR
BOOST_PP_REPEAT
BOOST_PP_REPEAT_2ND
BOOST_PP_REPEAT_3RD
BOOST_PP_REPEAT_FROM_TO
BOOST_PP_REPEAT_FROM_TO_2ND
BOOST_PP_REPEAT_FROM_TO_3RD
BOOST_PP_STRINGIZE
BOOST_PP_SUB
BOOST_PP_SUB_D
BOOST_PP_TUPLE_EAT
BOOST_PP_TUPLE_ELEM
BOOST_PP_TUPLE_REVERSE

View File

@ -1,10 +0,0 @@
If you have suggestions for additions or improvements to this library,
please e-mail such suggestions to boost@yahoogroups.com, but also cc
them to vesa_karvonen@hotmail.com.
Current:
- Writing examples
- Improving documentation
- Categorization of preprocessor bugs
- Faster preprocessing
- Faster arithmetic

View File

@ -29,6 +29,9 @@
<h2><a name="BOOST_PP_ADD">#define BOOST_PP_ADD</a>(X,Y)</h2>
<p>Expands to the sum of <code>X</code> and <code>Y</code>.</p>
<p>Both <code>X</code> and <code>Y</code> must expand to integer literals
in the range [0, <a href="limits.htm#BOOST_PP_LIMIT_MAG">BOOST_PP_LIMIT_MAG</a>].</p>
<p>For example, <code><a href="arithmetic_add.htm#BOOST_PP_ADD">BOOST_PP_ADD</a>(4,3)</code> expands to <code>7</code> (a
single token).</p>
@ -44,8 +47,8 @@ single token).</p>
<hr>
<h2><a name="BOOST_PREPROCESSOR_ADD">#define BOOST_PREPROCESSOR_ADD</a>(X,Y)</h2>
<p>Obsolete. Use <a href="arithmetic_add.htm#BOOST_PP_ADD">BOOST_PP_ADD</a>().</p>
<h2><a name="BOOST_PP_ADD_D">#define BOOST_PP_ADD_D</a>(D,X,Y)</h2>
<p>Can be used inside <a href="while.htm#BOOST_PP_WHILE">BOOST_PP_WHILE</a>().</p>
<hr>
<a href="arithmetic.htm">Prev</a> <a href="arithmetic_div.htm">Next</a> <a href="index.htm#Macros">Macros</a> <a href="index.htm#Headers">Headers</a>

View File

@ -29,6 +29,9 @@
<h2><a name="BOOST_PP_DIV">#define BOOST_PP_DIV</a>(X,Y)</h2>
<p>Expands to the quotient of <code>X</code> and <code>Y</code>.</p>
<p>Both <code>X</code> and <code>Y</code> must expand to integer literals
in the range [0, <a href="limits.htm#BOOST_PP_LIMIT_MAG">BOOST_PP_LIMIT_MAG</a>].</p>
<p>For example, <code><a href="arithmetic_div.htm#BOOST_PP_DIV">BOOST_PP_DIV</a>(4,3)</code> expands to <code>1</code> (a
single token).</p>
@ -44,8 +47,8 @@ single token).</p>
<hr>
<h2><a name="BOOST_PREPROCESSOR_DIV">#define BOOST_PREPROCESSOR_DIV</a>(X,Y)</h2>
<p>Obsolete. Use <a href="arithmetic_div.htm#BOOST_PP_DIV">BOOST_PP_DIV</a>().</p>
<h2><a name="BOOST_PP_DIV_D">#define BOOST_PP_DIV_D</a>(D,X,Y)</h2>
<p>Can be used inside <a href="while.htm#BOOST_PP_WHILE">BOOST_PP_WHILE</a>().</p>
<hr>
<a href="arithmetic_add.htm">Prev</a> <a href="arithmetic_mod.htm">Next</a> <a href="index.htm#Macros">Macros</a> <a href="index.htm#Headers">Headers</a>

View File

@ -29,6 +29,9 @@
<h2><a name="BOOST_PP_MOD">#define BOOST_PP_MOD</a>(X,Y)</h2>
<p>Expands to the remainder of <code>X</code> and <code>Y</code>.</p>
<p>Both <code>X</code> and <code>Y</code> must expand to integer literals
in the range [0, <a href="limits.htm#BOOST_PP_LIMIT_MAG">BOOST_PP_LIMIT_MAG</a>].</p>
<p>For example, <code><a href="arithmetic_mod.htm#BOOST_PP_MOD">BOOST_PP_MOD</a>(4,3)</code> expands to <code>1</code> (a
single token).</p>
@ -44,8 +47,8 @@ single token).</p>
<hr>
<h2><a name="BOOST_PREPROCESSOR_MOD">#define BOOST_PREPROCESSOR_MOD</a>(X,Y)</h2>
<p>Obsolete. Use <a href="arithmetic_mod.htm#BOOST_PP_MOD">BOOST_PP_MOD</a>().</p>
<h2><a name="BOOST_PP_MOD_D">#define BOOST_PP_MOD_D</a>(D,X,Y)</h2>
<p>Can be used inside <a href="while.htm#BOOST_PP_WHILE">BOOST_PP_WHILE</a>().</p>
<hr>
<a href="arithmetic_div.htm">Prev</a> <a href="arithmetic_mul.htm">Next</a> <a href="index.htm#Macros">Macros</a> <a href="index.htm#Headers">Headers</a>

View File

@ -29,6 +29,9 @@
<h2><a name="BOOST_PP_MUL">#define BOOST_PP_MUL</a>(X,Y)</h2>
<p>Expands to the product of <code>X</code> and <code>Y</code>.</p>
<p>Both <code>X</code> and <code>Y</code> must expand to integer literals
in the range [0, <a href="limits.htm#BOOST_PP_LIMIT_MAG">BOOST_PP_LIMIT_MAG</a>].</p>
<p>For example, <code><a href="arithmetic_mul.htm#BOOST_PP_MUL">BOOST_PP_MUL</a>(4,3)</code> expands to <code>12</code> (a
single token).</p>
@ -44,8 +47,8 @@ single token).</p>
<hr>
<h2><a name="BOOST_PREPROCESSOR_MUL">#define BOOST_PREPROCESSOR_MUL</a>(X,Y)</h2>
<p>Obsolete. Use <a href="arithmetic_mul.htm#BOOST_PP_MUL">BOOST_PP_MUL</a>().</p>
<h2><a name="BOOST_PP_MUL_D">#define BOOST_PP_MUL_D</a>(D,X,Y)</h2>
<p>Can be used inside <a href="while.htm#BOOST_PP_WHILE">BOOST_PP_WHILE</a>().</p>
<hr>
<a href="arithmetic_mod.htm">Prev</a> <a href="arithmetic_sub.htm">Next</a> <a href="index.htm#Macros">Macros</a> <a href="index.htm#Headers">Headers</a>

View File

@ -29,6 +29,9 @@
<h2><a name="BOOST_PP_SUB">#define BOOST_PP_SUB</a>(X,Y)</h2>
<p>Expands to the difference of <code>X</code> and <code>Y</code>.</p>
<p>Both <code>X</code> and <code>Y</code> must expand to integer literals
in the range [0, <a href="limits.htm#BOOST_PP_LIMIT_MAG">BOOST_PP_LIMIT_MAG</a>].</p>
<p>For example, <code><a href="arithmetic_sub.htm#BOOST_PP_SUB">BOOST_PP_SUB</a>(4,3)</code> expands to <code>1</code> (a
single token).</p>
@ -44,8 +47,8 @@ single token).</p>
<hr>
<h2><a name="BOOST_PREPROCESSOR_SUB">#define BOOST_PREPROCESSOR_SUB</a>(X,Y)</h2>
<p>Obsolete. Use <a href="arithmetic_sub.htm#BOOST_PP_SUB">BOOST_PP_SUB</a>(X,Y).</p>
<h2><a name="BOOST_PP_SUB_D">#define BOOST_PP_SUB_D</a>(D,X,Y)</h2>
<p>Can be used inside <a href="while.htm#BOOST_PP_WHILE">BOOST_PP_WHILE</a>().</p>
<hr>
<a href="arithmetic_mul.htm">Prev</a> <a href="assert_msg.htm">Next</a> <a href="index.htm#Macros">Macros</a> <a href="index.htm#Headers">Headers</a>

View File

@ -26,13 +26,14 @@
<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>
<hr>
<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 in the range [0, <a href="limits.htm#BOOST_PP_LIMIT_MAG">BOOST_PP_LIMIT_MAG</a>].</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>
<h2><a name="BOOST_PREPROCESSOR_ASSERT_MSG">#define BOOST_PREPROCESSOR_ASSERT_MSG</a>(C,MSG)</h2>
<p>Obsolete. Use <a href="assert_msg.htm#BOOST_PP_ASSERT_MSG">BOOST_PP_ASSERT_MSG</a>().</p>
<hr>
<a href="arithmetic_sub.htm">Prev</a> <a href="cat.htm">Next</a> <a href="index.htm#Macros">Macros</a> <a href="index.htm#Headers">Headers</a>

View File

@ -30,6 +30,8 @@
<p>Concatenates <code>X</code> and <code>Y</code> after they are macro
expanded.</p>
<p>For example, <code><a href="cat.htm#BOOST_PP_CAT">BOOST_PP_CAT</a>(A,<a href="cat.htm#BOOST_PP_CAT">BOOST_PP_CAT</a>(_,B))</code> expands to <code>A_B</code>.</p>
<h3>Example</h3>
<ul>
<li><a href="../../example/static_assert.c">static_assert.c</a></li>
@ -42,10 +44,6 @@ expanded.</p>
<hr>
<h2><a name="BOOST_PREPROCESSOR_CAT">#define BOOST_PREPROCESSOR_CAT</a>(X,Y)</h2>
<p>Obsolete. Use <a href="cat.htm#BOOST_PP_CAT">BOOST_PP_CAT</a>().</p>
<hr>
<a href="assert_msg.htm">Prev</a> <a href="comma.htm">Next</a> <a href="index.htm#Macros">Macros</a> <a href="index.htm#Headers">Headers</a>
<hr>

View File

@ -27,7 +27,18 @@
<hr>
<h2><a name="BOOST_PP_COMMA">#define BOOST_PP_COMMA</a>()</h2>
<p>Expands to a comma. Can be used with <a href="if.htm#BOOST_PP_IF">BOOST_PP_IF</a>().</p>
<p>Expands to a comma.</p>
<p>Commas need special handling in preprocessor code, because commas are used
for separating macro parameters.</p>
<p>For example,</p>
<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>)()
</pre>
<p>expands to a comma.</p>
<h3>See</h3>
<ul>
@ -36,10 +47,6 @@
<hr>
<h2><a name="BOOST_PREPROCESSOR_COMMA">#define BOOST_PREPROCESSOR_COMMA</a>()</h2>
<p>Obsolete. Use <a href="comma.htm#BOOST_PP_COMMA">BOOST_PP_COMMA</a>().</p>
<hr>
<a href="cat.htm">Prev</a> <a href="comma_if.htm">Next</a> <a href="index.htm#Macros">Macros</a> <a href="index.htm#Headers">Headers</a>
<hr>

View File

@ -26,14 +26,14 @@
<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>
<hr>
<p><code>COND</code> must expand to an integer literal in the range [0, <a href="limits.htm#BOOST_PP_LIMIT_MAG">BOOST_PP_LIMIT_MAG</a>].</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>
<h2><a name="BOOST_PREPROCESSOR_COMMA_IF">#define BOOST_PREPROCESSOR_COMMA_IF</a>(C)</h2>
<p>Obsolete. Use <a href="comma_if.htm#BOOST_PP_COMMA_IF">BOOST_PP_COMMA_IF</a>().</p>
<hr>
<a href="comma.htm">Prev</a> <a href="comparison.htm">Next</a> <a href="index.htm#Macros">Macros</a> <a href="index.htm#Headers">Headers</a>

View File

@ -30,6 +30,11 @@
<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
in the range [0, <a href="limits.htm#BOOST_PP_LIMIT_MAG">BOOST_PP_LIMIT_MAG</a>].</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>
<ul>
<li><a href="while.htm#BOOST_PP_WHILE">BOOST_PP_WHILE</a>()</li>
@ -42,8 +47,8 @@ otherwise.</p>
<hr>
<h2><a name="BOOST_PREPROCESSOR_EQUAL">#define BOOST_PREPROCESSOR_EQUAL</a>(X,Y)</h2>
<p>Obsolete. Use <a href="comparison_equal.htm#BOOST_PP_EQUAL">BOOST_PP_EQUAL</a>().</p>
<h2><a name="BOOST_PP_EQUAL_D">#define BOOST_PP_EQUAL_D</a>(D,X,Y)</h2>
<p>Can be used inside <a href="while.htm#BOOST_PP_WHILE">BOOST_PP_WHILE</a>().</p>
<hr>
<a href="comparison.htm">Prev</a> <a href="comparison_greater.htm">Next</a> <a href="index.htm#Macros">Macros</a> <a href="index.htm#Headers">Headers</a>

View File

@ -30,6 +30,11 @@
<p>Expands to <code>1</code> if <code>X &gt; Y</code> and <code>0</code>
otherwise.</p>
<p>Both <code>X</code> and <code>Y</code> must expand to integer literals
in the range [0, <a href="limits.htm#BOOST_PP_LIMIT_MAG">BOOST_PP_LIMIT_MAG</a>].</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>
<ul>
<li><a href="while.htm#BOOST_PP_WHILE">BOOST_PP_WHILE</a>()</li>
@ -42,8 +47,8 @@ otherwise.</p>
<hr>
<h2><a name="BOOST_PREPROCESSOR_GREATER">#define BOOST_PREPROCESSOR_GREATER</a>(X,Y)</h2>
<p>Obsolete. Use <a href="comparison_greater.htm#BOOST_PP_GREATER">BOOST_PP_GREATER</a>().</p>
<h2><a name="BOOST_PP_GREATER_D">#define BOOST_PP_GREATER_D</a>(D,X,Y)</h2>
<p>Can be used inside <a href="while.htm#BOOST_PP_WHILE">BOOST_PP_WHILE</a>().</p>
<hr>
<a href="comparison_equal.htm">Prev</a> <a href="comparison_greater_equal.htm">Next</a> <a href="index.htm#Macros">Macros</a> <a href="index.htm#Headers">Headers</a>

View File

@ -30,6 +30,11 @@
<p>Expands to <code>1</code> if <code>X &gt;= Y</code> and <code>0</code>
otherwise.</p>
<p>Both <code>X</code> and <code>Y</code> must expand to integer literals
in the range [0, <a href="limits.htm#BOOST_PP_LIMIT_MAG">BOOST_PP_LIMIT_MAG</a>].</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>
<ul>
<li><a href="while.htm#BOOST_PP_WHILE">BOOST_PP_WHILE</a>()</li>
@ -42,8 +47,8 @@ otherwise.</p>
<hr>
<h2><a name="BOOST_PREPROCESSOR_GREATER_EQUAL">#define BOOST_PREPROCESSOR_GREATER_EQUAL</a>(X,Y)</h2>
<p>Obsolete. Use <a href="comparison_greater_equal.htm#BOOST_PP_GREATER_EQUAL">BOOST_PP_GREATER_EQUAL</a>().</p>
<h2><a name="BOOST_PP_GREATER_EQUAL_D">#define BOOST_PP_GREATER_EQUAL_D</a>(D,X,Y)</h2>
<p>Can be used inside <a href="while.htm#BOOST_PP_WHILE">BOOST_PP_WHILE</a>().</p>
<hr>
<a href="comparison_greater.htm">Prev</a> <a href="comparison_less.htm">Next</a> <a href="index.htm#Macros">Macros</a> <a href="index.htm#Headers">Headers</a>

View File

@ -30,6 +30,11 @@
<p>Expands to <code>1</code> if <code>X &lt; Y</code> and <code>0</code>
otherwise.</p>
<p>Both <code>X</code> and <code>Y</code> must expand to integer literals
in the range [0, <a href="limits.htm#BOOST_PP_LIMIT_MAG">BOOST_PP_LIMIT_MAG</a>].</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>
<ul>
<li><a href="while.htm#BOOST_PP_WHILE">BOOST_PP_WHILE</a>()</li>
@ -42,8 +47,8 @@ otherwise.</p>
<hr>
<h2><a name="BOOST_PREPROCESSOR_LESS">#define BOOST_PREPROCESSOR_LESS</a>(X,Y)</h2>
<p>Obsolete. Use <a href="comparison_less.htm#BOOST_PP_LESS">BOOST_PP_LESS</a>().</p>
<h2><a name="BOOST_PP_LESS_D">#define BOOST_PP_LESS_D</a>(D,X,Y)</h2>
<p>Can be used inside <a href="while.htm#BOOST_PP_WHILE">BOOST_PP_WHILE</a>().</p>
<hr>
<a href="comparison_greater_equal.htm">Prev</a> <a href="comparison_less_equal.htm">Next</a> <a href="index.htm#Macros">Macros</a> <a href="index.htm#Headers">Headers</a>

View File

@ -30,6 +30,11 @@
<p>Expands to <code>1</code> if <code>X &lt;= Y</code> and <code>0</code>
otherwise.</p>
<p>Both <code>X</code> and <code>Y</code> must expand to integer literals
in the range [0, <a href="limits.htm#BOOST_PP_LIMIT_MAG">BOOST_PP_LIMIT_MAG</a>].</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>
<ul>
<li><a href="while.htm#BOOST_PP_WHILE">BOOST_PP_WHILE</a>()</li>
@ -42,8 +47,8 @@ otherwise.</p>
<hr>
<h2><a name="BOOST_PREPROCESSOR_LESS_EQUAL">#define BOOST_PREPROCESSOR_LESS_EQUAL</a>(X,Y)</h2>
<p>Obsolete. Use <a href="comparison_less_equal.htm#BOOST_PP_LESS_EQUAL">BOOST_PP_LESS_EQUAL</a>().</p>
<h2><a name="BOOST_PP_LESS_EQUAL_D">#define BOOST_PP_LESS_EQUAL_D</a>(D,X,Y)</h2>
<p>Can be used inside <a href="while.htm#BOOST_PP_WHILE">BOOST_PP_WHILE</a>().</p>
<hr>
<a href="comparison_less.htm">Prev</a> <a href="comparison_not_equal.htm">Next</a> <a href="index.htm#Macros">Macros</a> <a href="index.htm#Headers">Headers</a>

View File

@ -30,6 +30,11 @@
<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
in the range [0, <a href="limits.htm#BOOST_PP_LIMIT_MAG">BOOST_PP_LIMIT_MAG</a>].</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>
<ul>
<li><a href="while.htm#BOOST_PP_WHILE">BOOST_PP_WHILE</a>()</li>
@ -42,8 +47,8 @@ otherwise.</p>
<hr>
<h2><a name="BOOST_PREPROCESSOR_NOT_EQUAL">#define BOOST_PREPROCESSOR_NOT_EQUAL</a>(X,Y)</h2>
<p>Obsolete. Use <a href="comparison_not_equal.htm#BOOST_PP_NOT_EQUAL">BOOST_PP_NOT_EQUAL</a>().</p>
<h2><a name="BOOST_PP_NOT_EQUAL_D">#define BOOST_PP_NOT_EQUAL_D</a>(D,X,Y)</h2>
<p>Can be used inside <a href="while.htm#BOOST_PP_WHILE">BOOST_PP_WHILE</a>().</p>
<hr>
<a href="comparison_less_equal.htm">Prev</a> <a href="dec.htm">Next</a> <a href="index.htm#Macros">Macros</a> <a href="index.htm#Headers">Headers</a>

View File

@ -39,10 +39,6 @@ supported.</p>
<hr>
<h2><a name="BOOST_PREPROCESSOR_DEC">#define BOOST_PREPROCESSOR_DEC</a>(X)</h2>
<p>Obsolete. Use <a href="dec.htm#BOOST_PP_DEC">BOOST_PP_DEC</a>().</p>
<hr>
<a href="comparison_not_equal.htm">Prev</a> <a href="empty.htm">Next</a> <a href="index.htm#Macros">Macros</a> <a href="index.htm#Headers">Headers</a>
<hr>

View File

@ -27,7 +27,15 @@
<hr>
<h2><a name="BOOST_PP_EMPTY">#define BOOST_PP_EMPTY</a>()</h2>
<p>Expands to nothing. Used with <a href="if.htm#BOOST_PP_IF">BOOST_PP_IF</a>() and as an unused parameter.</p>
<p>Expands to nothing.</p>
<p>For example,</p>
<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>)()
</pre>
<p>expands to nothing.</p>
<h3>Example</h3>
<ul>
@ -41,10 +49,6 @@
<hr>
<h2><a name="BOOST_PREPROCESSOR_EMPTY">#define BOOST_PREPROCESSOR_EMPTY</a>()</h2>
<p>Obsolete. Use <a href="empty.htm#BOOST_PP_EMPTY">BOOST_PP_EMPTY</a>().</p>
<hr>
<a href="dec.htm">Prev</a> <a href="enum.htm">Next</a> <a href="index.htm#Macros">Macros</a> <a href="index.htm#Headers">Headers</a>
<hr>

View File

@ -26,13 +26,27 @@
<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(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>
<p>expands to:</p>
<pre>
X0 x0, X1 x1, X2 x2
</pre>
<h3>Uses</h3>

View File

@ -26,13 +26,25 @@
<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>
<pre>
<a href="enum_params.htm#BOOST_PP_ENUM_PARAMS">BOOST_PP_ENUM_PARAMS</a>(3,x)
</pre>
<p>expands to:</p>
<pre>
x0, x1, x2
</pre>
<h3>Uses</h3>
@ -47,10 +59,6 @@
<hr>
<h2><a name="BOOST_PREPROCESSOR_ENUM_PARAMS">#define BOOST_PREPROCESSOR_ENUM_PARAMS</a>(N,P)</h2>
<p>Obsolete. Use <a href="enum_params.htm#BOOST_PP_ENUM_PARAMS">BOOST_PP_ENUM_PARAMS</a>().</p>
<hr>
<a href="enum.htm">Prev</a> <a href="enum_params_with_a_default.htm">Next</a> <a href="index.htm#Macros">Macros</a> <a href="index.htm#Headers">Headers</a>
<hr>

View File

@ -26,13 +26,28 @@
<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>
<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)
</pre>
<p>expands to:</p>
<pre>
x0 = y, x1 = y, x2 = y
</pre>
<h3>Uses</h3>
@ -47,10 +62,6 @@
<hr>
<h2><a name="BOOST_PREPROCESSOR_ENUM_PARAMS_WITH_A_DEFAULT">#define BOOST_PREPROCESSOR_ENUM_PARAMS_WITH_A_DEFAULT</a>(N,P,D)</h2>
<p>Obsolete. Use <a href="enum_params_with_a_default.htm#BOOST_PP_ENUM_PARAMS_WITH_A_DEFAULT">BOOST_PP_ENUM_PARAMS_WITH_A_DEFAULT</a>().</p>
<hr>
<a href="enum_params.htm">Prev</a> <a href="enum_params_with_defaults.htm">Next</a> <a href="index.htm#Macros">Macros</a> <a href="index.htm#Headers">Headers</a>
<hr>

View File

@ -26,16 +26,28 @@
<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>
<pre>
<a href="enum_params_with_defaults.htm#BOOST_PP_ENUM_PARAMS_WITH_DEFAULTS">BOOST_PP_ENUM_PARAMS_WITH_DEFAULTS</a>(3,x,y)
</pre>
<p>expands to:</p>
<pre>
x0 = y0, x1 = y1, x2 = y2
</pre>
<h3>Uses</h3>
@ -50,10 +62,6 @@
<hr>
<h2><a name="BOOST_PREPROCESSOR_ENUM_PARAMS_WITH_DEFAULTS">#define BOOST_PREPROCESSOR_ENUM_PARAMS_WITH_DEFAULTS</a>(N,P,D)</h2>
<p>Obsolete. Use <a href="enum_params_with_defaults.htm#BOOST_PP_ENUM_PARAMS_WITH_DEFAULTS">BOOST_PP_ENUM_PARAMS_WITH_DEFAULTS</a>().</p>
<hr>
<a href="enum_params_with_a_default.htm">Prev</a> <a href="enum_shifted.htm">Next</a> <a href="index.htm#Macros">Macros</a> <a href="index.htm#Headers">Headers</a>
<hr>

View File

@ -26,13 +26,27 @@
<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(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>
<p>expands to:</p>
<pre>
X1 x1, X2 x2
</pre>
<h3>Uses</h3>

View File

@ -26,13 +26,24 @@
<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>
<pre>
<a href="enum_shifted_params.htm#BOOST_PP_ENUM_SHIFTED_PARAMS">BOOST_PP_ENUM_SHIFTED_PARAMS</a>(3,x)
</pre>
<p>expands to:</p>
<pre>
x1, x2
</pre>
<h3>Uses</h3>
@ -53,10 +64,6 @@
<hr>
<h2><a name="BOOST_PREPROCESSOR_ENUM_SHIFTED_PARAMS">#define BOOST_PREPROCESSOR_ENUM_SHIFTED_PARAMS</a>(N,P)</h2>
<p>Obsolete. Use <a href="enum_shifted_params.htm#BOOST_PP_ENUM_SHIFTED_PARAMS">BOOST_PP_ENUM_SHIFTED_PARAMS</a>().</p>
<hr>
<a href="enum_shifted.htm">Prev</a> <a href="expand.htm">Next</a> <a href="index.htm#Macros">Macros</a> <a href="index.htm#Headers">Headers</a>
<hr>

View File

@ -19,7 +19,7 @@
<hr>
<a href="enum_shifted_params.htm">Prev</a> <a href="for.htm">Next</a> <a href="index.htm#Macros">Macros</a> <a href="index.htm#Headers">Headers</a>
<a href="enum_shifted_params.htm">Prev</a> <a href="expr_if.htm">Next</a> <a href="index.htm#Macros">Macros</a> <a href="index.htm#Headers">Headers</a>
<hr>
<h1>#include &lt;<a href="../../../../boost/preprocessor/expand.hpp">boost/preprocessor/expand.hpp</a>&gt;</h1>
@ -30,7 +30,7 @@
<p>Essentially macro expands the parameter <code>X</code> twice.</p>
<hr>
<a href="enum_shifted_params.htm">Prev</a> <a href="for.htm">Next</a> <a href="index.htm#Macros">Macros</a> <a href="index.htm#Headers">Headers</a>
<a href="enum_shifted_params.htm">Prev</a> <a href="expr_if.htm">Next</a> <a href="index.htm#Macros">Macros</a> <a href="index.htm#Headers">Headers</a>
<hr>
<p>Revised <!--webbot bot="Timestamp" s-type="EDITED" s-format="%d %b %Y" startspan --><!--webbot bot="Timestamp" endspan i-checksum="15246" --></p>

55
doc/reference/expr_if.htm Normal file
View File

@ -0,0 +1,55 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Boost.Preprocessor - Reference</title>
</head>
<body bgcolor="#FFFFFF" link="#0000ff" vlink="#800080">
<table border="0" cellpadding="7" cellspacing="0" width="100%" summary=
"header">
<tr>
<td valign="top" width="300">
<h3><a href="../../../../index.htm"><img height="86" width="277" alt="C++ Boost" src="../../../../c++boost.gif" border="0"></a></h3>
</td>
<td valign="top">
<h1 align="center">Boost.Preprocessor</h1>
<h2 align="center">Reference</h2>
</td>
</tr>
</table>
<hr>
<a href="expand.htm">Prev</a> <a href="for.htm">Next</a> <a href="index.htm#Macros">Macros</a> <a href="index.htm#Headers">Headers</a>
<hr>
<h1>#include &lt;<a href="../../../../boost/preprocessor/expr_if.hpp">boost/preprocessor/expr_if.hpp</a>&gt;</h1>
<hr>
<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 in the range [0, <a href="limits.htm#BOOST_PP_LIMIT_MAG">BOOST_PP_LIMIT_MAG</a>].</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>
<h3>See</h3>
<ul>
<li><a href="if.htm#BOOST_PP_IF">BOOST_PP_IF</a>()</li>
</ul>
<hr>
<a href="expand.htm">Prev</a> <a href="for.htm">Next</a> <a href="index.htm#Macros">Macros</a> <a href="index.htm#Headers">Headers</a>
<hr>
<p>Revised <!--webbot bot="Timestamp" s-type="EDITED" s-format="%d %b %Y" startspan --><!--webbot bot="Timestamp" endspan i-checksum="15246" --></p>
<p><i>&copy; Copyright <a href="http://www.housemarque.com">Housemarque Oy</a> 2002</i></p>
<p><i>Permission to copy, use, modify, sell and distribute this document is granted
provided this copyright notice appears in all copies. This document is provided
"as is" without express or implied warranty, and with no claim as to its suitability
for any purpose.</i></p>
</body></html>

View File

@ -19,40 +19,59 @@
<hr>
<a href="expand.htm">Prev</a> <a href="identity.htm">Next</a> <a href="index.htm#Macros">Macros</a> <a href="index.htm#Headers">Headers</a>
<a href="expr_if.htm">Prev</a> <a href="identity.htm">Next</a> <a href="index.htm#Macros">Macros</a> <a href="index.htm#Headers">Headers</a>
<hr>
<h1>#include &lt;<a href="../../../../boost/preprocessor/for.hpp">boost/preprocessor/for.hpp</a>&gt;</h1>
<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 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>
<pre>
0 1 2
</pre>
<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>
@ -74,7 +93,7 @@ invoking <a href="for.htm#BOOST_PP_FOR">BOOST_PP_FOR</a>##R() directly.</p>
<hr>
<a href="expand.htm">Prev</a> <a href="identity.htm">Next</a> <a href="index.htm#Macros">Macros</a> <a href="index.htm#Headers">Headers</a>
<a href="expr_if.htm">Prev</a> <a href="identity.htm">Next</a> <a href="index.htm#Macros">Macros</a> <a href="index.htm#Headers">Headers</a>
<hr>
<p>Revised <!--webbot bot="Timestamp" s-type="EDITED" s-format="%d %b %Y" startspan --><!--webbot bot="Timestamp" endspan i-checksum="15246" --></p>

View File

@ -51,10 +51,6 @@ invoked.</p>
<hr>
<h2><a name="BOOST_PREPROCESSOR_IDENTITY">#define BOOST_PREPROCESSOR_IDENTITY</a>(X)</h2>
<p>Obsolete. Use <a href="identity.htm#BOOST_PP_IDENTITY">BOOST_PP_IDENTITY</a>().</p>
<hr>
<a href="for.htm">Prev</a> <a href="if.htm">Next</a> <a href="index.htm#Macros">Macros</a> <a href="index.htm#Headers">Headers</a>
<hr>

View File

@ -26,12 +26,18 @@
<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><a href="if.htm#BOOST_PP_IF">BOOST_PP_IF</a>() enables convenient generation of lists using
<a href="repeat.htm#BOOST_PP_REPEAT">BOOST_PP_REPEAT</a>().</p>
<p><code>COND</code> must expand to an integer literal in the range [0, <a href="limits.htm#BOOST_PP_LIMIT_MAG">BOOST_PP_LIMIT_MAG</a>].</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>
<h3>See</h3>
<ul>
<li><a href="expr_if.htm#BOOST_PP_EXPR_IF">BOOST_PP_EXPR_IF</a>()</li>
</ul>
<h3>Test</h3>
<ul>
@ -40,10 +46,6 @@
<hr>
<h2><a name="BOOST_PREPROCESSOR_IF">#define BOOST_PREPROCESSOR_IF</a>(C,T,E)</h2>
<p>Obsolete. Use <a href="if.htm#BOOST_PP_IF">BOOST_PP_IF</a>().</p>
<hr>
<a href="identity.htm">Prev</a> <a href="inc.htm">Next</a> <a href="index.htm#Macros">Macros</a> <a href="index.htm#Headers">Headers</a>
<hr>

View File

@ -40,10 +40,6 @@ supported.</p>
<hr>
<h2><a name="BOOST_PREPROCESSOR_INC">#define BOOST_PREPROCESSOR_INC</a>(X)</h2>
<p>Obsolete. Use <a href="inc.htm#BOOST_PP_INC">BOOST_PP_INC</a>().</p>
<hr>
<a href="if.htm">Prev</a> <a href="limits.htm">Next</a> <a href="index.htm#Macros">Macros</a> <a href="index.htm#Headers">Headers</a>
<hr>

View File

@ -22,6 +22,7 @@
<dl>
<dt><a href="arithmetic_add.htm#BOOST_PP_ADD">BOOST_PP_ADD</a></dt>
<dt><a href="arithmetic_add.htm#BOOST_PP_ADD_D">BOOST_PP_ADD_D</a></dt>
<dt><a href="logical_and.htm#BOOST_PP_AND">BOOST_PP_AND</a></dt>
<dt><a href="assert_msg.htm#BOOST_PP_ASSERT_MSG">BOOST_PP_ASSERT_MSG</a></dt>
<dt><a href="logical_bool.htm#BOOST_PP_BOOL">BOOST_PP_BOOL</a></dt>
@ -30,6 +31,7 @@
<dt><a href="comma_if.htm#BOOST_PP_COMMA_IF">BOOST_PP_COMMA_IF</a></dt>
<dt><a href="dec.htm#BOOST_PP_DEC">BOOST_PP_DEC</a></dt>
<dt><a href="arithmetic_div.htm#BOOST_PP_DIV">BOOST_PP_DIV</a></dt>
<dt><a href="arithmetic_div.htm#BOOST_PP_DIV_D">BOOST_PP_DIV_D</a></dt>
<dt><a href="empty.htm#BOOST_PP_EMPTY">BOOST_PP_EMPTY</a></dt>
<dt><a href="enum.htm#BOOST_PP_ENUM">BOOST_PP_ENUM</a></dt>
<dt><a href="enum_params.htm#BOOST_PP_ENUM_PARAMS">BOOST_PP_ENUM_PARAMS</a></dt>
@ -38,98 +40,94 @@
<dt><a href="enum_shifted.htm#BOOST_PP_ENUM_SHIFTED">BOOST_PP_ENUM_SHIFTED</a></dt>
<dt><a href="enum_shifted_params.htm#BOOST_PP_ENUM_SHIFTED_PARAMS">BOOST_PP_ENUM_SHIFTED_PARAMS</a></dt>
<dt><a href="comparison_equal.htm#BOOST_PP_EQUAL">BOOST_PP_EQUAL</a></dt>
<dt><a href="comparison_equal.htm#BOOST_PP_EQUAL_D">BOOST_PP_EQUAL_D</a></dt>
<dt><a href="expand.htm#BOOST_PP_EXPAND">BOOST_PP_EXPAND</a></dt>
<dt><a href="expr_if.htm#BOOST_PP_EXPR_IF">BOOST_PP_EXPR_IF</a></dt>
<dt><a href="for.htm#BOOST_PP_FOR">BOOST_PP_FOR</a></dt>
<dt><a href="comparison_greater.htm#BOOST_PP_GREATER">BOOST_PP_GREATER</a></dt>
<dt><a href="comparison_greater.htm#BOOST_PP_GREATER_D">BOOST_PP_GREATER_D</a></dt>
<dt><a href="comparison_greater_equal.htm#BOOST_PP_GREATER_EQUAL">BOOST_PP_GREATER_EQUAL</a></dt>
<dt><a href="comparison_greater_equal.htm#BOOST_PP_GREATER_EQUAL_D">BOOST_PP_GREATER_EQUAL_D</a></dt>
<dt><a href="identity.htm#BOOST_PP_IDENTITY">BOOST_PP_IDENTITY</a></dt>
<dt><a href="if.htm#BOOST_PP_IF">BOOST_PP_IF</a></dt>
<dt><a href="inc.htm#BOOST_PP_INC">BOOST_PP_INC</a></dt>
<dt><a href="comparison_less.htm#BOOST_PP_LESS">BOOST_PP_LESS</a></dt>
<dt><a href="comparison_less.htm#BOOST_PP_LESS_D">BOOST_PP_LESS_D</a></dt>
<dt><a href="comparison_less_equal.htm#BOOST_PP_LESS_EQUAL">BOOST_PP_LESS_EQUAL</a></dt>
<dt><a href="comparison_less_equal.htm#BOOST_PP_LESS_EQUAL_D">BOOST_PP_LESS_EQUAL_D</a></dt>
<dt><a href="limits.htm#BOOST_PP_LIMIT_DIM">BOOST_PP_LIMIT_DIM</a></dt>
<dt><a href="limits.htm#BOOST_PP_LIMIT_MAG">BOOST_PP_LIMIT_MAG</a></dt>
<dt><a href="limits.htm#BOOST_PP_LIMIT_TUPLE">BOOST_PP_LIMIT_TUPLE</a></dt>
<dt><a href="list_append.htm#BOOST_PP_LIST_APPEND">BOOST_PP_LIST_APPEND</a></dt>
<dt><a href="list_append.htm#BOOST_PP_LIST_APPEND_D">BOOST_PP_LIST_APPEND_D</a></dt>
<dt><a href="list_at.htm#BOOST_PP_LIST_AT">BOOST_PP_LIST_AT</a></dt>
<dt><a href="list_at.htm#BOOST_PP_LIST_AT_D">BOOST_PP_LIST_AT_D</a></dt>
<dt><a href="list_cat.htm#BOOST_PP_LIST_CAT">BOOST_PP_LIST_CAT</a></dt>
<dt><a href="list_cat.htm#BOOST_PP_LIST_CAT_D">BOOST_PP_LIST_CAT_D</a></dt>
<dt><a href="list_adt.htm#BOOST_PP_LIST_CONS">BOOST_PP_LIST_CONS</a></dt>
<dt><a href="list_enum.htm#BOOST_PP_LIST_ENUM">BOOST_PP_LIST_ENUM</a></dt>
<dt><a href="list_enum.htm#BOOST_PP_LIST_ENUM_R">BOOST_PP_LIST_ENUM_R</a></dt>
<dt><a href="list_filter.htm#BOOST_PP_LIST_FILTER">BOOST_PP_LIST_FILTER</a></dt>
<dt><a href="list_filter.htm#BOOST_PP_LIST_FILTER_D">BOOST_PP_LIST_FILTER_D</a></dt>
<dt><a href="list_adt.htm#BOOST_PP_LIST_FIRST">BOOST_PP_LIST_FIRST</a></dt>
<dt><a href="list_first_n.htm#BOOST_PP_LIST_FIRST_N">BOOST_PP_LIST_FIRST_N</a></dt>
<dt><a href="list_first_n.htm#BOOST_PP_LIST_FIRST_N_D">BOOST_PP_LIST_FIRST_N_D</a></dt>
<dt><a href="list_fold_left.htm#BOOST_PP_LIST_FOLD_LEFT">BOOST_PP_LIST_FOLD_LEFT</a></dt>
<dt><a href="list_fold_left_2nd.htm#BOOST_PP_LIST_FOLD_LEFT_2ND">BOOST_PP_LIST_FOLD_LEFT_2ND</a></dt>
<dt><a href="list_fold_left_2nd.htm#BOOST_PP_LIST_FOLD_LEFT_2ND_D">BOOST_PP_LIST_FOLD_LEFT_2ND_D</a></dt>
<dt><a href="list_fold_left.htm#BOOST_PP_LIST_FOLD_LEFT_D">BOOST_PP_LIST_FOLD_LEFT_D</a></dt>
<dt><a href="list_fold_right.htm#BOOST_PP_LIST_FOLD_RIGHT">BOOST_PP_LIST_FOLD_RIGHT</a></dt>
<dt><a href="list_fold_right_2nd.htm#BOOST_PP_LIST_FOLD_RIGHT_2ND">BOOST_PP_LIST_FOLD_RIGHT_2ND</a></dt>
<dt><a href="list_fold_right_2nd.htm#BOOST_PP_LIST_FOLD_RIGHT_2ND_D">BOOST_PP_LIST_FOLD_RIGHT_2ND_D</a></dt>
<dt><a href="list_fold_right.htm#BOOST_PP_LIST_FOLD_RIGHT_D">BOOST_PP_LIST_FOLD_RIGHT_D</a></dt>
<dt><a href="list_for_each.htm#BOOST_PP_LIST_FOR_EACH">BOOST_PP_LIST_FOR_EACH</a></dt>
<dt><a href="list_for_each_i.htm#BOOST_PP_LIST_FOR_EACH_I">BOOST_PP_LIST_FOR_EACH_I</a></dt>
<dt><a href="list_for_each_i.htm#BOOST_PP_LIST_FOR_EACH_I_R">BOOST_PP_LIST_FOR_EACH_I_R</a></dt>
<dt><a href="list_for_each_product.htm#BOOST_PP_LIST_FOR_EACH_PRODUCT">BOOST_PP_LIST_FOR_EACH_PRODUCT</a></dt>
<dt><a href="list_for_each_product.htm#BOOST_PP_LIST_FOR_EACH_PRODUCT_R">BOOST_PP_LIST_FOR_EACH_PRODUCT_R</a></dt>
<dt><a href="list_for_each.htm#BOOST_PP_LIST_FOR_EACH_R">BOOST_PP_LIST_FOR_EACH_R</a></dt>
<dt><a href="list_adt.htm#BOOST_PP_LIST_IS_CONS">BOOST_PP_LIST_IS_CONS</a></dt>
<dt><a href="list_adt.htm#BOOST_PP_LIST_IS_NIL">BOOST_PP_LIST_IS_NIL</a></dt>
<dt><a href="list_adt.htm#BOOST_PP_LIST_NIL">BOOST_PP_LIST_NIL</a></dt>
<dt><a href="list_adt.htm#BOOST_PP_LIST_REST">BOOST_PP_LIST_REST</a></dt>
<dt><a href="list_rest_n.htm#BOOST_PP_LIST_REST_N">BOOST_PP_LIST_REST_N</a></dt>
<dt><a href="list_rest_n.htm#BOOST_PP_LIST_REST_N_D">BOOST_PP_LIST_REST_N_D</a></dt>
<dt><a href="list_reverse.htm#BOOST_PP_LIST_REVERSE">BOOST_PP_LIST_REVERSE</a></dt>
<dt><a href="list_reverse.htm#BOOST_PP_LIST_REVERSE_D">BOOST_PP_LIST_REVERSE_D</a></dt>
<dt><a href="list_size.htm#BOOST_PP_LIST_SIZE">BOOST_PP_LIST_SIZE</a></dt>
<dt><a href="list_size.htm#BOOST_PP_LIST_SIZE_D">BOOST_PP_LIST_SIZE_D</a></dt>
<dt><a href="list_to_tuple.htm#BOOST_PP_LIST_TO_TUPLE">BOOST_PP_LIST_TO_TUPLE</a></dt>
<dt><a href="list_to_tuple.htm#BOOST_PP_LIST_TO_TUPLE_R">BOOST_PP_LIST_TO_TUPLE_R</a></dt>
<dt><a href="list_transform.htm#BOOST_PP_LIST_TRANSFORM">BOOST_PP_LIST_TRANSFORM</a></dt>
<dt><a href="list_transform.htm#BOOST_PP_LIST_TRANSFORM_D">BOOST_PP_LIST_TRANSFORM_D</a></dt>
<dt><a href="max.htm#BOOST_PP_MAX">BOOST_PP_MAX</a></dt>
<dt><a href="max.htm#BOOST_PP_MAX_D">BOOST_PP_MAX_D</a></dt>
<dt><a href="min.htm#BOOST_PP_MIN">BOOST_PP_MIN</a></dt>
<dt><a href="min.htm#BOOST_PP_MIN_D">BOOST_PP_MIN_D</a></dt>
<dt><a href="arithmetic_mod.htm#BOOST_PP_MOD">BOOST_PP_MOD</a></dt>
<dt><a href="arithmetic_mod.htm#BOOST_PP_MOD_D">BOOST_PP_MOD_D</a></dt>
<dt><a href="arithmetic_mul.htm#BOOST_PP_MUL">BOOST_PP_MUL</a></dt>
<dt><a href="arithmetic_mul.htm#BOOST_PP_MUL_D">BOOST_PP_MUL_D</a></dt>
<dt><a href="logical_nor.htm#BOOST_PP_NOR">BOOST_PP_NOR</a></dt>
<dt><a href="logical_not.htm#BOOST_PP_NOT">BOOST_PP_NOT</a></dt>
<dt><a href="comparison_not_equal.htm#BOOST_PP_NOT_EQUAL">BOOST_PP_NOT_EQUAL</a></dt>
<dt><a href="comparison_not_equal.htm#BOOST_PP_NOT_EQUAL_D">BOOST_PP_NOT_EQUAL_D</a></dt>
<dt><a href="logical_or.htm#BOOST_PP_OR">BOOST_PP_OR</a></dt>
<dt><a href="repeat.htm#BOOST_PP_REPEAT">BOOST_PP_REPEAT</a></dt>
<dt><a href="repeat_2nd.htm#BOOST_PP_REPEAT_2ND">BOOST_PP_REPEAT_2ND</a></dt>
<dt><a href="repeat_3rd.htm#BOOST_PP_REPEAT_3RD">BOOST_PP_REPEAT_3RD</a></dt>
<dt><a href="repeat_from_to.htm#BOOST_PP_REPEAT_FROM_TO">BOOST_PP_REPEAT_FROM_TO</a></dt>
<dt><a href="repeat_from_to_2nd.htm#BOOST_PP_REPEAT_FROM_TO_2ND">BOOST_PP_REPEAT_FROM_TO_2ND</a></dt>
<dt><a href="repeat_from_to_3rd.htm#BOOST_PP_REPEAT_FROM_TO_3RD">BOOST_PP_REPEAT_FROM_TO_3RD</a></dt>
<dt><a href="stringize.htm#BOOST_PP_STRINGIZE">BOOST_PP_STRINGIZE</a></dt>
<dt><a href="arithmetic_sub.htm#BOOST_PP_SUB">BOOST_PP_SUB</a></dt>
<dt><a href="arithmetic_sub.htm#BOOST_PP_SUB_D">BOOST_PP_SUB_D</a></dt>
<dt><a href="tuple_eat.htm#BOOST_PP_TUPLE_EAT">BOOST_PP_TUPLE_EAT</a></dt>
<dt><a href="tuple_elem.htm#BOOST_PP_TUPLE_ELEM">BOOST_PP_TUPLE_ELEM</a></dt>
<dt><a href="tuple_reverse.htm#BOOST_PP_TUPLE_REVERSE">BOOST_PP_TUPLE_REVERSE</a></dt>
<dt><a href="tuple_to_list.htm#BOOST_PP_TUPLE_TO_LIST">BOOST_PP_TUPLE_TO_LIST</a></dt>
<dt><a href="while.htm#BOOST_PP_WHILE">BOOST_PP_WHILE</a></dt>
<dt><a href="logical_xor.htm#BOOST_PP_XOR">BOOST_PP_XOR</a></dt>
<dt><a href="arithmetic_add.htm#BOOST_PREPROCESSOR_ADD">BOOST_PREPROCESSOR_ADD</a></dt>
<dt><a href="logical_and.htm#BOOST_PREPROCESSOR_AND">BOOST_PREPROCESSOR_AND</a></dt>
<dt><a href="assert_msg.htm#BOOST_PREPROCESSOR_ASSERT_MSG">BOOST_PREPROCESSOR_ASSERT_MSG</a></dt>
<dt><a href="logical_bool.htm#BOOST_PREPROCESSOR_BOOL">BOOST_PREPROCESSOR_BOOL</a></dt>
<dt><a href="cat.htm#BOOST_PREPROCESSOR_CAT">BOOST_PREPROCESSOR_CAT</a></dt>
<dt><a href="comma.htm#BOOST_PREPROCESSOR_COMMA">BOOST_PREPROCESSOR_COMMA</a></dt>
<dt><a href="comma_if.htm#BOOST_PREPROCESSOR_COMMA_IF">BOOST_PREPROCESSOR_COMMA_IF</a></dt>
<dt><a href="dec.htm#BOOST_PREPROCESSOR_DEC">BOOST_PREPROCESSOR_DEC</a></dt>
<dt><a href="arithmetic_div.htm#BOOST_PREPROCESSOR_DIV">BOOST_PREPROCESSOR_DIV</a></dt>
<dt><a href="empty.htm#BOOST_PREPROCESSOR_EMPTY">BOOST_PREPROCESSOR_EMPTY</a></dt>
<dt><a href="enum_params.htm#BOOST_PREPROCESSOR_ENUM_PARAMS">BOOST_PREPROCESSOR_ENUM_PARAMS</a></dt>
<dt><a href="enum_params_with_a_default.htm#BOOST_PREPROCESSOR_ENUM_PARAMS_WITH_A_DEFAULT">BOOST_PREPROCESSOR_ENUM_PARAMS_WITH_A_DEFAULT</a></dt>
<dt><a href="enum_params_with_defaults.htm#BOOST_PREPROCESSOR_ENUM_PARAMS_WITH_DEFAULTS">BOOST_PREPROCESSOR_ENUM_PARAMS_WITH_DEFAULTS</a></dt>
<dt><a href="enum_shifted_params.htm#BOOST_PREPROCESSOR_ENUM_SHIFTED_PARAMS">BOOST_PREPROCESSOR_ENUM_SHIFTED_PARAMS</a></dt>
<dt><a href="comparison_equal.htm#BOOST_PREPROCESSOR_EQUAL">BOOST_PREPROCESSOR_EQUAL</a></dt>
<dt><a href="comparison_greater.htm#BOOST_PREPROCESSOR_GREATER">BOOST_PREPROCESSOR_GREATER</a></dt>
<dt><a href="comparison_greater_equal.htm#BOOST_PREPROCESSOR_GREATER_EQUAL">BOOST_PREPROCESSOR_GREATER_EQUAL</a></dt>
<dt><a href="identity.htm#BOOST_PREPROCESSOR_IDENTITY">BOOST_PREPROCESSOR_IDENTITY</a></dt>
<dt><a href="if.htm#BOOST_PREPROCESSOR_IF">BOOST_PREPROCESSOR_IF</a></dt>
<dt><a href="inc.htm#BOOST_PREPROCESSOR_INC">BOOST_PREPROCESSOR_INC</a></dt>
<dt><a href="comparison_less.htm#BOOST_PREPROCESSOR_LESS">BOOST_PREPROCESSOR_LESS</a></dt>
<dt><a href="comparison_less_equal.htm#BOOST_PREPROCESSOR_LESS_EQUAL">BOOST_PREPROCESSOR_LESS_EQUAL</a></dt>
<dt><a href="limits.htm#BOOST_PREPROCESSOR_LIMIT_DIM">BOOST_PREPROCESSOR_LIMIT_DIM</a></dt>
<dt><a href="limits.htm#BOOST_PREPROCESSOR_LIMIT_MAG">BOOST_PREPROCESSOR_LIMIT_MAG</a></dt>
<dt><a href="limits.htm#BOOST_PREPROCESSOR_LIMIT_TUPLE">BOOST_PREPROCESSOR_LIMIT_TUPLE</a></dt>
<dt><a href="max.htm#BOOST_PREPROCESSOR_MAX">BOOST_PREPROCESSOR_MAX</a></dt>
<dt><a href="min.htm#BOOST_PREPROCESSOR_MIN">BOOST_PREPROCESSOR_MIN</a></dt>
<dt><a href="arithmetic_mod.htm#BOOST_PREPROCESSOR_MOD">BOOST_PREPROCESSOR_MOD</a></dt>
<dt><a href="arithmetic_mul.htm#BOOST_PREPROCESSOR_MUL">BOOST_PREPROCESSOR_MUL</a></dt>
<dt><a href="logical_nor.htm#BOOST_PREPROCESSOR_NOR">BOOST_PREPROCESSOR_NOR</a></dt>
<dt><a href="logical_not.htm#BOOST_PREPROCESSOR_NOT">BOOST_PREPROCESSOR_NOT</a></dt>
<dt><a href="comparison_not_equal.htm#BOOST_PREPROCESSOR_NOT_EQUAL">BOOST_PREPROCESSOR_NOT_EQUAL</a></dt>
<dt><a href="logical_or.htm#BOOST_PREPROCESSOR_OR">BOOST_PREPROCESSOR_OR</a></dt>
<dt><a href="repeat.htm#BOOST_PREPROCESSOR_REPEAT">BOOST_PREPROCESSOR_REPEAT</a></dt>
<dt><a href="repeat_2nd.htm#BOOST_PREPROCESSOR_REPEAT_2ND">BOOST_PREPROCESSOR_REPEAT_2ND</a></dt>
<dt><a href="repeat_3rd.htm#BOOST_PREPROCESSOR_REPEAT_3RD">BOOST_PREPROCESSOR_REPEAT_3RD</a></dt>
<dt><a href="stringize.htm#BOOST_PREPROCESSOR_STRINGIZE">BOOST_PREPROCESSOR_STRINGIZE</a></dt>
<dt><a href="arithmetic_sub.htm#BOOST_PREPROCESSOR_SUB">BOOST_PREPROCESSOR_SUB</a></dt>
<dt><a href="tuple_elem.htm#BOOST_PREPROCESSOR_TUPLE_ELEM">BOOST_PREPROCESSOR_TUPLE_ELEM</a></dt>
<dt><a href="logical_xor.htm#BOOST_PREPROCESSOR_XOR">BOOST_PREPROCESSOR_XOR</a></dt>
</dl>
<hr>
@ -162,6 +160,7 @@
<dt>#include &lt;<a href="enum_shifted.htm">boost/preprocessor/enum_shifted.hpp</a>&gt;</dt>
<dt>#include &lt;<a href="enum_shifted_params.htm">boost/preprocessor/enum_shifted_params.hpp</a>&gt;</dt>
<dt>#include &lt;<a href="expand.htm">boost/preprocessor/expand.hpp</a>&gt;</dt>
<dt>#include &lt;<a href="expr_if.htm">boost/preprocessor/expr_if.hpp</a>&gt;</dt>
<dt>#include &lt;<a href="for.htm">boost/preprocessor/for.hpp</a>&gt;</dt>
<dt>#include &lt;<a href="identity.htm">boost/preprocessor/identity.hpp</a>&gt;</dt>
<dt>#include &lt;<a href="if.htm">boost/preprocessor/if.hpp</a>&gt;</dt>
@ -176,8 +175,11 @@
<dt>#include &lt;<a href="list_filter.htm">boost/preprocessor/list/filter.hpp</a>&gt;</dt>
<dt>#include &lt;<a href="list_first_n.htm">boost/preprocessor/list/first_n.hpp</a>&gt;</dt>
<dt>#include &lt;<a href="list_fold_left.htm">boost/preprocessor/list/fold_left.hpp</a>&gt;</dt>
<dt>#include &lt;<a href="list_fold_left_2nd.htm">boost/preprocessor/list/fold_left_2nd.hpp</a>&gt;</dt>
<dt>#include &lt;<a href="list_fold_right.htm">boost/preprocessor/list/fold_right.hpp</a>&gt;</dt>
<dt>#include &lt;<a href="list_fold_right_2nd.htm">boost/preprocessor/list/fold_right_2nd.hpp</a>&gt;</dt>
<dt>#include &lt;<a href="list_for_each.htm">boost/preprocessor/list/for_each.hpp</a>&gt;</dt>
<dt>#include &lt;<a href="list_for_each_i.htm">boost/preprocessor/list/for_each_i.hpp</a>&gt;</dt>
<dt>#include &lt;<a href="list_for_each_product.htm">boost/preprocessor/list/for_each_product.hpp</a>&gt;</dt>
<dt>#include &lt;<a href="list_rest_n.htm">boost/preprocessor/list/rest_n.hpp</a>&gt;</dt>
<dt>#include &lt;<a href="list_reverse.htm">boost/preprocessor/list/reverse.hpp</a>&gt;</dt>
@ -196,6 +198,9 @@
<dt>#include &lt;<a href="repeat.htm">boost/preprocessor/repeat.hpp</a>&gt;</dt>
<dt>#include &lt;<a href="repeat_2nd.htm">boost/preprocessor/repeat_2nd.hpp</a>&gt;</dt>
<dt>#include &lt;<a href="repeat_3rd.htm">boost/preprocessor/repeat_3rd.hpp</a>&gt;</dt>
<dt>#include &lt;<a href="repeat_from_to.htm">boost/preprocessor/repeat_from_to.hpp</a>&gt;</dt>
<dt>#include &lt;<a href="repeat_from_to_2nd.htm">boost/preprocessor/repeat_from_to_2nd.hpp</a>&gt;</dt>
<dt>#include &lt;<a href="repeat_from_to_3rd.htm">boost/preprocessor/repeat_from_to_3rd.hpp</a>&gt;</dt>
<dt>#include &lt;<a href="stringize.htm">boost/preprocessor/stringize.hpp</a>&gt;</dt>
<dt>#include &lt;<a href="tuple.htm">boost/preprocessor/tuple.hpp</a>&gt;</dt>
<dt>#include &lt;<a href="tuple_eat.htm">boost/preprocessor/tuple/eat.hpp</a>&gt;</dt>

View File

@ -55,19 +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>
<hr>
<h2><a name="BOOST_PREPROCESSOR_LIMIT_DIM">#define BOOST_PREPROCESSOR_LIMIT_DIM</a></h2>
<p>Obsolete. Use <a href="limits.htm#BOOST_PP_LIMIT_DIM">BOOST_PP_LIMIT_DIM</a>.</p>
<hr>
<h2><a name="BOOST_PREPROCESSOR_LIMIT_MAG">#define BOOST_PREPROCESSOR_LIMIT_MAG</a></h2>
<p>Obsolete. Use <a href="limits.htm#BOOST_PP_LIMIT_MAG">BOOST_PP_LIMIT_MAG</a>.</p>
<hr>
<h2><a name="BOOST_PREPROCESSOR_LIMIT_TUPLE">#define BOOST_PREPROCESSOR_LIMIT_TUPLE</a></h2>
<p>Obsolete. Use <a href="limits.htm#BOOST_PP_LIMIT_TUPLE">BOOST_PP_LIMIT_TUPLE</a>.</p>
<p>Expands to the maximum tuple size supported by the library.</p>
<hr>
<a href="inc.htm">Prev</a> <a href="list.htm">Next</a> <a href="index.htm#Macros">Macros</a> <a href="index.htm#Headers">Headers</a>

View File

@ -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
@ -57,7 +57,21 @@
<p>Both of the above lists contain 5 elements: 1, 2, 3, 4 and 5.</p>
<p>Longer lists can be built with the help of <a href="list_append.htm#BOOST_PP_LIST_APPEND">BOOST_PP_LIST_APPEND</a>().</p>
<p>Longer lists can be built from short lists with <a href="list_append.htm#BOOST_PP_LIST_APPEND_D">BOOST_PP_LIST_APPEND_D</a>()
and <a href="list_fold_right_2nd.htm#BOOST_PP_LIST_FOLD_RIGHT_2ND">BOOST_PP_LIST_FOLD_RIGHT_2ND</a>():</p>
<pre>
<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="tuple_to_list.htm#BOOST_PP_TUPLE_TO_LIST">BOOST_PP_TUPLE_TO_LIST</a>
( 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, (E21, E22, ..., E2M) )
, ...
, <a href="tuple_to_list.htm#BOOST_PP_TUPLE_TO_LIST">BOOST_PP_TUPLE_TO_LIST</a>(M, (EN1, EN2, ..., ENM) )
)
)
</pre>
<hr>
@ -65,15 +79,15 @@
<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>
@ -86,7 +100,7 @@
<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>

View File

@ -26,7 +26,7 @@
<hr>
<h2><a name="BOOST_PP_LIST_APPEND">#define BOOST_PP_LIST_APPEND</a>(L,P)</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,6 +56,10 @@
<hr>
<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>
<a href="list_adt.htm">Prev</a> <a href="list_at.htm">Next</a> <a href="index.htm#Macros">Macros</a> <a href="index.htm#Headers">Headers</a>
<hr>

View File

@ -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,6 +50,10 @@ 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,LIST,INDEX)</h2>
<p>Can be used inside <a href="while.htm#BOOST_PP_WHILE">BOOST_PP_WHILE</a>().</p>
<hr>
<a href="list_append.htm">Prev</a> <a href="list_cat.htm">Next</a> <a href="index.htm#Macros">Macros</a> <a href="index.htm#Headers">Headers</a>
<hr>

View File

@ -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,6 +53,10 @@
<hr>
<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>
<a href="list_at.htm">Prev</a> <a href="list_enum.htm">Next</a> <a href="index.htm#Macros">Macros</a> <a href="index.htm#Headers">Headers</a>
<hr>

View File

@ -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>
@ -43,11 +43,15 @@
<h3>Uses</h3>
<ul>
<li><a href="for.htm#BOOST_PP_FOR">BOOST_PP_FOR</a>()</li>
<li><a href="list_for_each_i.htm#BOOST_PP_LIST_FOR_EACH_I">BOOST_PP_LIST_FOR_EACH_I</a>()</li>
</ul>
<hr>
<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>
<a href="list_cat.htm">Prev</a> <a href="list_filter.htm">Next</a> <a href="index.htm#Macros">Macros</a> <a href="index.htm#Headers">Headers</a>
<hr>

View File

@ -26,14 +26,14 @@
<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>
<pre>
<a href="list_filter.htm#BOOST_PP_LIST_FILTER">BOOST_PP_LIST_FILTER</a>(BOOST_PP_NOT_EQUAL_D,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>
<p>expands to the same as:</p>
@ -44,6 +44,7 @@ for which <code>F(D,P,X)</code> is true.</p>
<h3>Uses</h3>
<ul>
<li><a href="while.htm#BOOST_PP_WHILE">BOOST_PP_WHILE</a>() (see for explanation of the D parameter)</li>
<li><a href="list_fold_right.htm#BOOST_PP_LIST_FOLD_RIGHT">BOOST_PP_LIST_FOLD_RIGHT</a>()</li>
</ul>
@ -54,6 +55,10 @@ 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,PRED,DATA,LIST)</h2>
<p>Can be used inside <a href="while.htm#BOOST_PP_WHILE">BOOST_PP_WHILE</a>().</p>
<hr>
<a href="list_enum.htm">Prev</a> <a href="list_first_n.htm">Next</a> <a href="index.htm#Macros">Macros</a> <a href="index.htm#Headers">Headers</a>
<hr>

View File

@ -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,6 +59,10 @@
<hr>
<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>
<a href="list_filter.htm">Prev</a> <a href="list_fold_left.htm">Next</a> <a href="index.htm#Macros">Macros</a> <a href="index.htm#Headers">Headers</a>
<hr>

View File

@ -19,27 +19,40 @@
<hr>
<a href="list_first_n.htm">Prev</a> <a href="list_fold_right.htm">Next</a> <a href="index.htm#Macros">Macros</a> <a href="index.htm#Headers">Headers</a>
<a href="list_first_n.htm">Prev</a> <a href="list_fold_left_2nd.htm">Next</a> <a href="index.htm#Macros">Macros</a> <a href="index.htm#Headers">Headers</a>
<hr>
<h1>#include &lt;<a href="../../../../boost/preprocessor/list/fold_left.hpp">boost/preprocessor/list/fold_left.hpp</a>&gt;</h1>
<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,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>
<p>expands to:</p>
<pre>
_ABC
</pre>
<h3>Note</h3>
<ul>
<li>Folding, or accumulation, is a very general pattern of computation.
@ -53,7 +66,7 @@ list <code>L</code> (from the left or the start of the list).</p>
<h3>Uses</h3>
<ul>
<li><a href="while.htm#BOOST_PP_WHILE">BOOST_PP_WHILE</a>()</li>
<li><a href="while.htm#BOOST_PP_WHILE">BOOST_PP_WHILE</a>() (see for explanation of the D parameter)</li>
</ul>
<h3>Test</h3>
@ -63,7 +76,11 @@ list <code>L</code> (from the left or the start of the list).</p>
<hr>
<a href="list_first_n.htm">Prev</a> <a href="list_fold_right.htm">Next</a> <a href="index.htm#Macros">Macros</a> <a href="index.htm#Headers">Headers</a>
<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>
<a href="list_first_n.htm">Prev</a> <a href="list_fold_left_2nd.htm">Next</a> <a href="index.htm#Macros">Macros</a> <a href="index.htm#Headers">Headers</a>
<hr>
<p>Revised <!--webbot bot="Timestamp" s-type="EDITED" s-format="%d %b %Y" startspan --><!--webbot bot="Timestamp" endspan i-checksum="15246" --></p>

View File

@ -0,0 +1,49 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Boost.Preprocessor - Reference</title>
</head>
<body bgcolor="#FFFFFF" link="#0000ff" vlink="#800080">
<table border="0" cellpadding="7" cellspacing="0" width="100%" summary=
"header">
<tr>
<td valign="top" width="300">
<h3><a href="../../../../index.htm"><img height="86" width="277" alt="C++ Boost" src="../../../../c++boost.gif" border="0"></a></h3>
</td>
<td valign="top">
<h1 align="center">Boost.Preprocessor</h1>
<h2 align="center">Reference</h2>
</td>
</tr>
</table>
<hr>
<a href="list_fold_left.htm">Prev</a> <a href="list_fold_right.htm">Next</a> <a href="index.htm#Macros">Macros</a> <a href="index.htm#Headers">Headers</a>
<hr>
<h1>#include &lt;<a href="../../../../boost/preprocessor/list/fold_left_2nd.hpp">boost/preprocessor/list/fold_left_2nd.hpp</a>&gt;</h1>
<hr>
<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,OP,STATE,LIST)</h2>
<p>Can be used inside <a href="while.htm#BOOST_PP_WHILE">BOOST_PP_WHILE</a>().</p>
<hr>
<a href="list_fold_left.htm">Prev</a> <a href="list_fold_right.htm">Next</a> <a href="index.htm#Macros">Macros</a> <a href="index.htm#Headers">Headers</a>
<hr>
<p>Revised <!--webbot bot="Timestamp" s-type="EDITED" s-format="%d %b %Y" startspan --><!--webbot bot="Timestamp" endspan i-checksum="15246" --></p>
<p><i>&copy; Copyright <a href="http://www.housemarque.com">Housemarque Oy</a> 2002</i></p>
<p><i>Permission to copy, use, modify, sell and distribute this document is granted
provided this copyright notice appears in all copies. This document is provided
"as is" without express or implied warranty, and with no claim as to its suitability
for any purpose.</i></p>
</body></html>

View File

@ -19,37 +19,51 @@
<hr>
<a href="list_fold_left.htm">Prev</a> <a href="list_for_each.htm">Next</a> <a href="index.htm#Macros">Macros</a> <a href="index.htm#Headers">Headers</a>
<a href="list_fold_left_2nd.htm">Prev</a> <a href="list_fold_right_2nd.htm">Next</a> <a href="index.htm#Macros">Macros</a> <a href="index.htm#Headers">Headers</a>
<hr>
<h1>#include &lt;<a href="../../../../boost/preprocessor/list/fold_right.hpp">boost/preprocessor/list/fold_right.hpp</a>&gt;</h1>
<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
)
) ...
)
</pre>
<p>For example,</p>
<pre>
#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>
<p>expands to:</p>
<pre>
_CBA
</pre>
<h3>Uses</h3>
<ul>
<li><a href="while.htm#BOOST_PP_WHILE">BOOST_PP_WHILE</a>() (see for explanation of the D parameter)</li>
<li><a href="list_fold_left.htm#BOOST_PP_LIST_FOLD_LEFT">BOOST_PP_LIST_FOLD_LEFT</a>()</li>
</ul>
@ -60,7 +74,11 @@ list <code>L</code> (from the right or the end of the list).</p>
<hr>
<a href="list_fold_left.htm">Prev</a> <a href="list_for_each.htm">Next</a> <a href="index.htm#Macros">Macros</a> <a href="index.htm#Headers">Headers</a>
<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>
<a href="list_fold_left_2nd.htm">Prev</a> <a href="list_fold_right_2nd.htm">Next</a> <a href="index.htm#Macros">Macros</a> <a href="index.htm#Headers">Headers</a>
<hr>
<p>Revised <!--webbot bot="Timestamp" s-type="EDITED" s-format="%d %b %Y" startspan --><!--webbot bot="Timestamp" endspan i-checksum="15246" --></p>

View File

@ -0,0 +1,49 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Boost.Preprocessor - Reference</title>
</head>
<body bgcolor="#FFFFFF" link="#0000ff" vlink="#800080">
<table border="0" cellpadding="7" cellspacing="0" width="100%" summary=
"header">
<tr>
<td valign="top" width="300">
<h3><a href="../../../../index.htm"><img height="86" width="277" alt="C++ Boost" src="../../../../c++boost.gif" border="0"></a></h3>
</td>
<td valign="top">
<h1 align="center">Boost.Preprocessor</h1>
<h2 align="center">Reference</h2>
</td>
</tr>
</table>
<hr>
<a href="list_fold_right.htm">Prev</a> <a href="list_for_each.htm">Next</a> <a href="index.htm#Macros">Macros</a> <a href="index.htm#Headers">Headers</a>
<hr>
<h1>#include &lt;<a href="../../../../boost/preprocessor/list/fold_right_2nd.hpp">boost/preprocessor/list/fold_right_2nd.hpp</a>&gt;</h1>
<hr>
<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,OP,LIST,STATE)</h2>
<p>Can be used inside <a href="while.htm#BOOST_PP_WHILE">BOOST_PP_WHILE</a>().</p>
<hr>
<a href="list_fold_right.htm">Prev</a> <a href="list_for_each.htm">Next</a> <a href="index.htm#Macros">Macros</a> <a href="index.htm#Headers">Headers</a>
<hr>
<p>Revised <!--webbot bot="Timestamp" s-type="EDITED" s-format="%d %b %Y" startspan --><!--webbot bot="Timestamp" endspan i-checksum="15246" --></p>
<p><i>&copy; Copyright <a href="http://www.housemarque.com">Housemarque Oy</a> 2002</i></p>
<p><i>Permission to copy, use, modify, sell and distribute this document is granted
provided this copyright notice appears in all copies. This document is provided
"as is" without express or implied warranty, and with no claim as to its suitability
for any purpose.</i></p>
</body></html>

View File

@ -19,24 +19,37 @@
<hr>
<a href="list_fold_right.htm">Prev</a> <a href="list_for_each_product.htm">Next</a> <a href="index.htm#Macros">Macros</a> <a href="index.htm#Headers">Headers</a>
<a href="list_fold_right_2nd.htm">Prev</a> <a href="list_for_each_i.htm">Next</a> <a href="index.htm#Macros">Macros</a> <a href="index.htm#Headers">Headers</a>
<hr>
<h1>#include &lt;<a href="../../../../boost/preprocessor/list/for_each.hpp">boost/preprocessor/list/for_each.hpp</a>&gt;</h1>
<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,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>
<p>expands to:</p>
<pre>
prefix_A(); prefix_B(); prefix_C();
</pre>
<h3>Example</h3>
@ -46,7 +59,8 @@
<h3>Uses</h3>
<ul>
<li><a href="for.htm#BOOST_PP_FOR">BOOST_PP_FOR</a>()</li>
<li><a href="for.htm#BOOST_PP_FOR">BOOST_PP_FOR</a>() (see for explanation of the R parameter)</li>
<li><a href="list_for_each_i.htm#BOOST_PP_LIST_FOR_EACH_I">BOOST_PP_LIST_FOR_EACH_I</a>() </li>
</ul>
<h3>Test</h3>
@ -56,7 +70,11 @@
<hr>
<a href="list_fold_right.htm">Prev</a> <a href="list_for_each_product.htm">Next</a> <a href="index.htm#Macros">Macros</a> <a href="index.htm#Headers">Headers</a>
<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>
<a href="list_fold_right_2nd.htm">Prev</a> <a href="list_for_each_i.htm">Next</a> <a href="index.htm#Macros">Macros</a> <a href="index.htm#Headers">Headers</a>
<hr>
<p>Revised <!--webbot bot="Timestamp" s-type="EDITED" s-format="%d %b %Y" startspan --><!--webbot bot="Timestamp" endspan i-checksum="15246" --></p>

View File

@ -0,0 +1,78 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Boost.Preprocessor - Reference</title>
</head>
<body bgcolor="#FFFFFF" link="#0000ff" vlink="#800080">
<table border="0" cellpadding="7" cellspacing="0" width="100%" summary=
"header">
<tr>
<td valign="top" width="300">
<h3><a href="../../../../index.htm"><img height="86" width="277" alt="C++ Boost" src="../../../../c++boost.gif" border="0"></a></h3>
</td>
<td valign="top">
<h1 align="center">Boost.Preprocessor</h1>
<h2 align="center">Reference</h2>
</td>
</tr>
</table>
<hr>
<a href="list_for_each.htm">Prev</a> <a href="list_for_each_product.htm">Next</a> <a href="index.htm#Macros">Macros</a> <a href="index.htm#Headers">Headers</a>
<hr>
<h1>#include &lt;<a href="../../../../boost/preprocessor/list/for_each_i.hpp">boost/preprocessor/list/for_each_i.hpp</a>&gt;</h1>
<hr>
<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>
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,<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,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>
<p>expands to:</p>
<pre>
prefix_A(0); prefix_B(1); prefix_C(2);
</pre>
<h3>Uses</h3>
<ul>
<li><a href="for.htm#BOOST_PP_FOR">BOOST_PP_FOR</a>() (see for explanation of the R parameter)</li>
</ul>
<hr>
<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>
<a href="list_for_each.htm">Prev</a> <a href="list_for_each_product.htm">Next</a> <a href="index.htm#Macros">Macros</a> <a href="index.htm#Headers">Headers</a>
<hr>
<p>Revised <!--webbot bot="Timestamp" s-type="EDITED" s-format="%d %b %Y" startspan --><!--webbot bot="Timestamp" endspan i-checksum="15246" --></p>
<p><i>&copy; Copyright <a href="http://www.housemarque.com">Housemarque Oy</a> 2002</i></p>
<p><i>Permission to copy, use, modify, sell and distribute this document is granted
provided this copyright notice appears in all copies. This document is provided
"as is" without express or implied warranty, and with no claim as to its suitability
for any purpose.</i></p>
</body></html>

View File

@ -19,20 +19,39 @@
<hr>
<a href="list_for_each.htm">Prev</a> <a href="list_rest_n.htm">Next</a> <a href="index.htm#Macros">Macros</a> <a href="index.htm#Headers">Headers</a>
<a href="list_for_each_i.htm">Prev</a> <a href="list_rest_n.htm">Next</a> <a href="index.htm#Macros">Macros</a> <a href="index.htm#Headers">Headers</a>
<hr>
<h1>#include &lt;<a href="../../../../boost/preprocessor/list/for_each_product.hpp">boost/preprocessor/list/for_each_product.hpp</a>&gt;</h1>
<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>
<p>For example,</p>
<pre>
#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>
( TEST
, 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>(2,(1,2))
)
)
</pre>
<p>expands to:</p>
<pre>
(A,1) (A,2) (B,1) (B,2) (C,1) (C,2)
</pre>
<h3>Example</h3>
<ul>
<li><a href="../../example/is_integral.cpp">is_integral.cpp</a></li>
@ -41,7 +60,7 @@ explosion.</p>
<h3>Uses</h3>
<ul>
<li><a href="for.htm#BOOST_PP_FOR">BOOST_PP_FOR</a>()</li>
<li><a href="for.htm#BOOST_PP_FOR">BOOST_PP_FOR</a>() (see for explanation of the R parameter)</li>
</ul>
<h3>Test</h3>
@ -51,7 +70,11 @@ explosion.</p>
<hr>
<a href="list_for_each.htm">Prev</a> <a href="list_rest_n.htm">Next</a> <a href="index.htm#Macros">Macros</a> <a href="index.htm#Headers">Headers</a>
<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>
<a href="list_for_each_i.htm">Prev</a> <a href="list_rest_n.htm">Next</a> <a href="index.htm#Macros">Macros</a> <a href="index.htm#Headers">Headers</a>
<hr>
<p>Revised <!--webbot bot="Timestamp" s-type="EDITED" s-format="%d %b %Y" startspan --><!--webbot bot="Timestamp" endspan i-checksum="15246" --></p>

View File

@ -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,6 +59,10 @@ list <code>L</code>.</p>
<hr>
<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>
<a href="list_for_each_product.htm">Prev</a> <a href="list_reverse.htm">Next</a> <a href="index.htm#Macros">Macros</a> <a href="index.htm#Headers">Headers</a>
<hr>

View File

@ -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,6 +53,10 @@
<hr>
<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>
<a href="list_rest_n.htm">Prev</a> <a href="list_size.htm">Next</a> <a href="index.htm#Macros">Macros</a> <a href="index.htm#Headers">Headers</a>
<hr>

View File

@ -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,6 +49,10 @@
<hr>
<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>
<a href="list_reverse.htm">Prev</a> <a href="list_to_tuple.htm">Next</a> <a href="index.htm#Macros">Macros</a> <a href="index.htm#Headers">Headers</a>
<hr>

View File

@ -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,6 +55,10 @@
<hr>
<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>
<a href="list_size.htm">Prev</a> <a href="list_transform.htm">Next</a> <a href="index.htm#Macros">Macros</a> <a href="index.htm#Headers">Headers</a>
<hr>

View File

@ -26,24 +26,24 @@
<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>
<p>For example,</p>
<pre>
<a href="list_transform.htm#BOOST_PP_LIST_TRANSFORM">BOOST_PP_LIST_TRANSFORM</a>(BOOST_PP_ADD_D,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>
<p>expands to the same as:</p>
@ -54,6 +54,7 @@ of the list producing a new list.</p>
<h3>Uses</h3>
<ul>
<li><a href="while.htm#BOOST_PP_WHILE">BOOST_PP_WHILE</a>() (see for explanation of the D parameter)</li>
<li><a href="list_fold_right.htm#BOOST_PP_LIST_FOLD_RIGHT">BOOST_PP_LIST_FOLD_RIGHT</a>()</li>
</ul>
@ -64,6 +65,10 @@ 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,OP,DATA,LIST)</h2>
<p>Can be used inside <a href="while.htm#BOOST_PP_WHILE">BOOST_PP_WHILE</a>().</p>
<hr>
<a href="list_to_tuple.htm">Prev</a> <a href="logical.htm">Next</a> <a href="index.htm#Macros">Macros</a> <a href="index.htm#Headers">Headers</a>
<hr>

View File

@ -29,6 +29,9 @@
<h2><a name="BOOST_PP_AND">#define BOOST_PP_AND</a>(X,Y)</h2>
<p>Expands to the logical AND of the operands.</p>
<p>Both <code>X</code> and <code>Y</code> must expand to integer literals
in the range [0, <a href="limits.htm#BOOST_PP_LIMIT_MAG">BOOST_PP_LIMIT_MAG</a>].</p>
<p>For example, <code><a href="logical_and.htm#BOOST_PP_AND">BOOST_PP_AND</a>(0,5)</code> expands to <code>0</code> (a single token).</p>
<h3>Test</h3>
@ -38,10 +41,6 @@
<hr>
<h2><a name="BOOST_PREPROCESSOR_AND">#define BOOST_PREPROCESSOR_AND</a>(X,Y)</h2>
<p>Obsolete. Use <a href="logical_and.htm#BOOST_PP_AND">BOOST_PP_AND</a>().</p>
<hr>
<a href="logical.htm">Prev</a> <a href="logical_bool.htm">Next</a> <a href="index.htm#Macros">Macros</a> <a href="index.htm#Headers">Headers</a>
<hr>

View File

@ -29,10 +29,10 @@
<h2><a name="BOOST_PP_BOOL">#define BOOST_PP_BOOL</a>(X)</h2>
<p>Expands to <code>0</code> if <code>X == 0</code> and <code>1</code> if <code>X != 0</code>.</p>
<hr>
<p><code>X</code> must be an integer literal in the range [0, <a href="limits.htm#BOOST_PP_LIMIT_MAG">BOOST_PP_LIMIT_MAG</a>].</p>
<p>For example, <code><a href="logical_bool.htm#BOOST_PP_BOOL">BOOST_PP_BOOL</a>(3)</code> expands to <code>1</code>.</p>
<h2><a name="BOOST_PREPROCESSOR_BOOL">#define BOOST_PREPROCESSOR_BOOL</a>(X)</h2>
<p>Obsolete. Use <a href="logical_bool.htm#BOOST_PP_BOOL">BOOST_PP_BOOL</a>().</p>
<hr>
<a href="logical_and.htm">Prev</a> <a href="logical_nor.htm">Next</a> <a href="index.htm#Macros">Macros</a> <a href="index.htm#Headers">Headers</a>

View File

@ -29,6 +29,9 @@
<h2><a name="BOOST_PP_NOR">#define BOOST_PP_NOR</a>(X,Y)</h2>
<p>Expands to the logical NEITHER OR of the operands.</p>
<p>Both <code>X</code> and <code>Y</code> must expand to integer literals
in the range [0, <a href="limits.htm#BOOST_PP_LIMIT_MAG">BOOST_PP_LIMIT_MAG</a>].</p>
<p>For example, <code><a href="logical_nor.htm#BOOST_PP_NOR">BOOST_PP_NOR</a>(0,5)</code> expands to <code>0</code> (a single token).</p>
<h3>Test</h3>
@ -38,10 +41,6 @@
<hr>
<h2><a name="BOOST_PREPROCESSOR_NOR">#define BOOST_PREPROCESSOR_NOR</a>(X,Y)</h2>
<p>Obsolete. Use <a href="logical_nor.htm#BOOST_PP_NOR">BOOST_PP_NOR</a>().</p>
<hr>
<a href="logical_bool.htm">Prev</a> <a href="logical_not.htm">Next</a> <a href="index.htm#Macros">Macros</a> <a href="index.htm#Headers">Headers</a>
<hr>

View File

@ -29,6 +29,8 @@
<h2><a name="BOOST_PP_NOT">#define BOOST_PP_NOT</a>(X)</h2>
<p>Expands to the logical NOT of the operand.</p>
<p><code>X</code> must be an integer literal in the range [0, <a href="limits.htm#BOOST_PP_LIMIT_MAG">BOOST_PP_LIMIT_MAG</a>].</p>
<p>For example, <code><a href="logical_not.htm#BOOST_PP_NOT">BOOST_PP_NOT</a>(0)</code> expands to <code>1</code> (a single token).</p>
<h3>Test</h3>
@ -38,10 +40,6 @@
<hr>
<h2><a name="BOOST_PREPROCESSOR_NOT">#define BOOST_PREPROCESSOR_NOT</a>(X)</h2>
<p>Obsolete. Use <a href="logical_not.htm#BOOST_PP_NOT">BOOST_PP_NOT</a>().</p>
<hr>
<a href="logical_nor.htm">Prev</a> <a href="logical_or.htm">Next</a> <a href="index.htm#Macros">Macros</a> <a href="index.htm#Headers">Headers</a>
<hr>

View File

@ -29,6 +29,9 @@
<h2><a name="BOOST_PP_OR">#define BOOST_PP_OR</a>(X,Y)</h2>
<p>Expands to the logical OR of the operands.</p>
<p>Both <code>X</code> and <code>Y</code> must expand to integer literals
in the range [0, <a href="limits.htm#BOOST_PP_LIMIT_MAG">BOOST_PP_LIMIT_MAG</a>].</p>
<p>For example, <code><a href="logical_or.htm#BOOST_PP_OR">BOOST_PP_OR</a>(0,2)</code> expands to <code>1</code> (a single token).</p>
<h3>Test</h3>
@ -38,10 +41,6 @@
<hr>
<h2><a name="BOOST_PREPROCESSOR_OR">#define BOOST_PREPROCESSOR_OR</a>(X,Y)</h2>
<p>Obsolete. Use <a href="logical_or.htm#BOOST_PP_OR">BOOST_PP_OR</a>().</p>
<hr>
<a href="logical_not.htm">Prev</a> <a href="logical_xor.htm">Next</a> <a href="index.htm#Macros">Macros</a> <a href="index.htm#Headers">Headers</a>
<hr>

View File

@ -29,6 +29,9 @@
<h2><a name="BOOST_PP_XOR">#define BOOST_PP_XOR</a>(X,Y)</h2>
<p>Expands to the logical EXCLUSIVE OR of the operands.</p>
<p>Both <code>X</code> and <code>Y</code> must expand to integer literals
in the range [0, <a href="limits.htm#BOOST_PP_LIMIT_MAG">BOOST_PP_LIMIT_MAG</a>].</p>
<p>For example, <code><a href="logical_xor.htm#BOOST_PP_XOR">BOOST_PP_XOR</a>(1,2)</code> expands to <code>0</code> (a single token).</p>
<h3>Test</h3>
@ -38,10 +41,6 @@
<hr>
<h2><a name="BOOST_PREPROCESSOR_XOR">#define BOOST_PREPROCESSOR_XOR</a>(X,Y)</h2>
<p>Obsolete. Use <a href="logical_xor.htm#BOOST_PP_XOR">BOOST_PP_XOR</a>().</p>
<hr>
<a href="logical_or.htm">Prev</a> <a href="max.htm">Next</a> <a href="index.htm#Macros">Macros</a> <a href="index.htm#Headers">Headers</a>
<hr>

View File

@ -29,6 +29,9 @@
<h2><a name="BOOST_PP_MAX">#define BOOST_PP_MAX</a>(X,Y)</h2>
<p>Expands to the maximum of <code>X</code> and <code>Y</code>.</p>
<p>Both <code>X</code> and <code>Y</code> must expand to integer literals
in the range [0, <a href="limits.htm#BOOST_PP_LIMIT_MAG">BOOST_PP_LIMIT_MAG</a>].</p>
<p>For example, <code><a href="max.htm#BOOST_PP_MAX">BOOST_PP_MAX</a>(5,7)</code> expands to <code>7</code> (a
single token).</p>
@ -44,8 +47,8 @@ single token).</p>
<hr>
<h2><a name="BOOST_PREPROCESSOR_MAX">#define BOOST_PREPROCESSOR_MAX</a>(X,Y)</h2>
<p>Obsolete. Use <a href="max.htm#BOOST_PP_MAX">BOOST_PP_MAX</a>().</p>
<h2><a name="BOOST_PP_MAX_D">#define BOOST_PP_MAX_D</a>(D,X,Y)</h2>
<p>Can be used inside <a href="while.htm#BOOST_PP_WHILE">BOOST_PP_WHILE</a>().</p>
<hr>
<a href="logical_xor.htm">Prev</a> <a href="min.htm">Next</a> <a href="index.htm#Macros">Macros</a> <a href="index.htm#Headers">Headers</a>

View File

@ -29,6 +29,9 @@
<h2><a name="BOOST_PP_MIN">#define BOOST_PP_MIN</a>(X,Y)</h2>
<p>Expands to the minimum of <code>X</code> and <code>Y</code>.</p>
<p>Both <code>X</code> and <code>Y</code> must expand to integer literals
in the range [0, <a href="limits.htm#BOOST_PP_LIMIT_MAG">BOOST_PP_LIMIT_MAG</a>].</p>
<p>For example, <code><a href="min.htm#BOOST_PP_MIN">BOOST_PP_MIN</a>(5,7)</code> expands to <code>5</code> (a
single token).</p>
@ -44,8 +47,8 @@ single token).</p>
<hr>
<h2><a name="BOOST_PREPROCESSOR_MIN">#define BOOST_PREPROCESSOR_MIN</a>(X,Y)</h2>
<p>Obsolete. Use <a href="min.htm#BOOST_PP_MIN">BOOST_PP_MIN</a>().</p>
<h2><a name="BOOST_PP_MIN_D">#define BOOST_PP_MIN_D</a>(D,X,Y)</h2>
<p>Can be used inside <a href="while.htm#BOOST_PP_WHILE">BOOST_PP_WHILE</a>().</p>
<hr>
<a href="max.htm">Prev</a> <a href="repeat.htm">Next</a> <a href="index.htm#Macros">Macros</a> <a href="index.htm#Headers">Headers</a>

View File

@ -26,13 +26,26 @@
<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 I = [0,N-1[.</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(INDEX,DATA) DATA(INDEX);
<a href="repeat.htm#BOOST_PP_REPEAT">BOOST_PP_REPEAT</a>(3,TEST,X)
</pre>
<p>expands to:</p>
<pre>
X(0); X(1); X(2);
</pre>
<h3>2D and 3D repetition</h3>
@ -42,6 +55,7 @@
<h3>Example</h3>
<ul>
<li><a href="../../example/duffs_device.c">duffs_device.c</a></li>
<li><a href="../../example/repeat_2d.c">repeat_2d.c</a></li>
</ul>
@ -53,10 +67,6 @@
<hr>
<h2><a name="BOOST_PREPROCESSOR_REPEAT">#define BOOST_PREPROCESSOR_REPEAT</a>(N,M,P)</h2>
<p>Obsolete. Use <a href="repeat.htm#BOOST_PP_REPEAT">BOOST_PP_REPEAT</a>().</p>
<hr>
<a href="min.htm">Prev</a> <a href="repeat_2nd.htm">Next</a> <a href="index.htm#Macros">Macros</a> <a href="index.htm#Headers">Headers</a>
<hr>

View File

@ -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>
@ -36,10 +36,6 @@
<hr>
<h2><a name="BOOST_PREPROCESSOR_REPEAT_2ND">#define BOOST_PREPROCESSOR_REPEAT_2ND</a>(N,M,P)</h2>
<p>Obsolete. Use <a href="repeat_2nd.htm#BOOST_PP_REPEAT_2ND">BOOST_PP_REPEAT_2ND</a>().</p>
<hr>
<a href="repeat.htm">Prev</a> <a href="repeat_3rd.htm">Next</a> <a href="index.htm#Macros">Macros</a> <a href="index.htm#Headers">Headers</a>
<hr>

View File

@ -19,22 +19,18 @@
<hr>
<a href="repeat_2nd.htm">Prev</a> <a href="stringize.htm">Next</a> <a href="index.htm#Macros">Macros</a> <a href="index.htm#Headers">Headers</a>
<a href="repeat_2nd.htm">Prev</a> <a href="repeat_from_to.htm">Next</a> <a href="index.htm#Macros">Macros</a> <a href="index.htm#Headers">Headers</a>
<hr>
<h1>#include &lt;<a href="../../../../boost/preprocessor/repeat_3rd.hpp">boost/preprocessor/repeat_3rd.hpp</a>&gt;</h1>
<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>
<h2><a name="BOOST_PREPROCESSOR_REPEAT_3RD">#define BOOST_PREPROCESSOR_REPEAT_3RD</a>(N,M,P)</h2>
<p>Obsolete. Use <a href="repeat_3rd.htm#BOOST_PP_REPEAT_3RD">BOOST_PP_REPEAT_3RD</a>().</p>
<hr>
<a href="repeat_2nd.htm">Prev</a> <a href="stringize.htm">Next</a> <a href="index.htm#Macros">Macros</a> <a href="index.htm#Headers">Headers</a>
<a href="repeat_2nd.htm">Prev</a> <a href="repeat_from_to.htm">Next</a> <a href="index.htm#Macros">Macros</a> <a href="index.htm#Headers">Headers</a>
<hr>
<p>Revised <!--webbot bot="Timestamp" s-type="EDITED" s-format="%d %b %Y" startspan --><!--webbot bot="Timestamp" endspan i-checksum="15246" --></p>

View File

@ -0,0 +1,75 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Boost.Preprocessor - Reference</title>
</head>
<body bgcolor="#FFFFFF" link="#0000ff" vlink="#800080">
<table border="0" cellpadding="7" cellspacing="0" width="100%" summary=
"header">
<tr>
<td valign="top" width="300">
<h3><a href="../../../../index.htm"><img height="86" width="277" alt="C++ Boost" src="../../../../c++boost.gif" border="0"></a></h3>
</td>
<td valign="top">
<h1 align="center">Boost.Preprocessor</h1>
<h2 align="center">Reference</h2>
</td>
</tr>
</table>
<hr>
<a href="repeat_3rd.htm">Prev</a> <a href="repeat_from_to_2nd.htm">Next</a> <a href="index.htm#Macros">Macros</a> <a href="index.htm#Headers">Headers</a>
<hr>
<h1>#include &lt;<a href="../../../../boost/preprocessor/repeat_from_to.hpp">boost/preprocessor/repeat_from_to.hpp</a>&gt;</h1>
<hr>
<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>
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(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>
<p>expands to:</p>
<pre>
X(4); X(5); X(6);
</pre>
<h3>Uses</h3>
<ul>
<li><a href="repeat.htm#BOOST_PP_REPEAT">BOOST_PP_REPEAT</a>()</li>
</ul>
<h3>Test</h3>
<ul>
<li><a href="../../test/repeat_test.cpp">repeat_test.cpp</a></li>
</ul>
<hr>
<a href="repeat_3rd.htm">Prev</a> <a href="repeat_from_to_2nd.htm">Next</a> <a href="index.htm#Macros">Macros</a> <a href="index.htm#Headers">Headers</a>
<hr>
<p>Revised <!--webbot bot="Timestamp" s-type="EDITED" s-format="%d %b %Y" startspan --><!--webbot bot="Timestamp" endspan i-checksum="15246" --></p>
<p><i>&copy; Copyright <a href="http://www.housemarque.com">Housemarque Oy</a> 2002</i></p>
<p><i>Permission to copy, use, modify, sell and distribute this document is granted
provided this copyright notice appears in all copies. This document is provided
"as is" without express or implied warranty, and with no claim as to its suitability
for any purpose.</i></p>
</body></html>

View File

@ -0,0 +1,45 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Boost.Preprocessor - Reference</title>
</head>
<body bgcolor="#FFFFFF" link="#0000ff" vlink="#800080">
<table border="0" cellpadding="7" cellspacing="0" width="100%" summary=
"header">
<tr>
<td valign="top" width="300">
<h3><a href="../../../../index.htm"><img height="86" width="277" alt="C++ Boost" src="../../../../c++boost.gif" border="0"></a></h3>
</td>
<td valign="top">
<h1 align="center">Boost.Preprocessor</h1>
<h2 align="center">Reference</h2>
</td>
</tr>
</table>
<hr>
<a href="repeat_from_to.htm">Prev</a> <a href="repeat_from_to_3rd.htm">Next</a> <a href="index.htm#Macros">Macros</a> <a href="index.htm#Headers">Headers</a>
<hr>
<h1>#include &lt;<a href="../../../../boost/preprocessor/repeat_from_to_2nd.hpp">boost/preprocessor/repeat_from_to_2nd.hpp</a>&gt;</h1>
<hr>
<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>
<a href="repeat_from_to.htm">Prev</a> <a href="repeat_from_to_3rd.htm">Next</a> <a href="index.htm#Macros">Macros</a> <a href="index.htm#Headers">Headers</a>
<hr>
<p>Revised <!--webbot bot="Timestamp" s-type="EDITED" s-format="%d %b %Y" startspan --><!--webbot bot="Timestamp" endspan i-checksum="15246" --></p>
<p><i>&copy; Copyright <a href="http://www.housemarque.com">Housemarque Oy</a> 2002</i></p>
<p><i>Permission to copy, use, modify, sell and distribute this document is granted
provided this copyright notice appears in all copies. This document is provided
"as is" without express or implied warranty, and with no claim as to its suitability
for any purpose.</i></p>
</body></html>

View File

@ -0,0 +1,45 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Boost.Preprocessor - Reference</title>
</head>
<body bgcolor="#FFFFFF" link="#0000ff" vlink="#800080">
<table border="0" cellpadding="7" cellspacing="0" width="100%" summary=
"header">
<tr>
<td valign="top" width="300">
<h3><a href="../../../../index.htm"><img height="86" width="277" alt="C++ Boost" src="../../../../c++boost.gif" border="0"></a></h3>
</td>
<td valign="top">
<h1 align="center">Boost.Preprocessor</h1>
<h2 align="center">Reference</h2>
</td>
</tr>
</table>
<hr>
<a href="repeat_from_to_2nd.htm">Prev</a> <a href="stringize.htm">Next</a> <a href="index.htm#Macros">Macros</a> <a href="index.htm#Headers">Headers</a>
<hr>
<h1>#include &lt;<a href="../../../../boost/preprocessor/repeat_from_to_3rd.hpp">boost/preprocessor/repeat_from_to_3rd.hpp</a>&gt;</h1>
<hr>
<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>
<a href="repeat_from_to_2nd.htm">Prev</a> <a href="stringize.htm">Next</a> <a href="index.htm#Macros">Macros</a> <a href="index.htm#Headers">Headers</a>
<hr>
<p>Revised <!--webbot bot="Timestamp" s-type="EDITED" s-format="%d %b %Y" startspan --><!--webbot bot="Timestamp" endspan i-checksum="15246" --></p>
<p><i>&copy; Copyright <a href="http://www.housemarque.com">Housemarque Oy</a> 2002</i></p>
<p><i>Permission to copy, use, modify, sell and distribute this document is granted
provided this copyright notice appears in all copies. This document is provided
"as is" without express or implied warranty, and with no claim as to its suitability
for any purpose.</i></p>
</body></html>

View File

@ -19,7 +19,7 @@
<hr>
<a href="repeat_3rd.htm">Prev</a> <a href="tuple.htm">Next</a> <a href="index.htm#Macros">Macros</a> <a href="index.htm#Headers">Headers</a>
<a href="repeat_from_to_3rd.htm">Prev</a> <a href="tuple.htm">Next</a> <a href="index.htm#Macros">Macros</a> <a href="index.htm#Headers">Headers</a>
<hr>
<h1>#include &lt;<a href="../../../../boost/preprocessor/stringize.hpp">boost/preprocessor/stringize.hpp</a>&gt;</h1>
@ -29,6 +29,8 @@
<h2><a name="BOOST_PP_STRINGIZE">#define BOOST_PP_STRINGIZE</a>(X)</h2>
<p>Stringizes <code>X</code> after it is macro expanded.</p>
<p>For example, <code><a href="stringize.htm#BOOST_PP_STRINGIZE">BOOST_PP_STRINGIZE</a>(<a href="cat.htm#BOOST_PP_CAT">BOOST_PP_CAT</a>(a,b))</code> expands to <code>"ab"</code>.</p>
<h3>Example</h3>
<ul>
<li><a href="../../example/note.c">note.c</a></li>
@ -41,11 +43,7 @@
<hr>
<h2><a name="BOOST_PREPROCESSOR_STRINGIZE">#define BOOST_PREPROCESSOR_STRINGIZE</a>(E)</h2>
<p>Obsolete. Use <a href="stringize.htm#BOOST_PP_STRINGIZE">BOOST_PP_STRINGIZE</a>().</p>
<hr>
<a href="repeat_3rd.htm">Prev</a> <a href="tuple.htm">Next</a> <a href="index.htm#Macros">Macros</a> <a href="index.htm#Headers">Headers</a>
<a href="repeat_from_to_3rd.htm">Prev</a> <a href="tuple.htm">Next</a> <a href="index.htm#Macros">Macros</a> <a href="index.htm#Headers">Headers</a>
<hr>
<p>Revised <!--webbot bot="Timestamp" s-type="EDITED" s-format="%d %b %Y" startspan --><!--webbot bot="Timestamp" endspan i-checksum="15246" --></p>

View File

@ -23,7 +23,24 @@
<hr>
<h1>#include &lt;<a href="../../../../boost/preprocessor/tuple.hpp">boost/preprocessor/tuple.hpp</a>&gt;</h1>
<p>Includes all tuple headers.</p>
<p>Includes all tuple headers.</p>
<p>A tuple is a fixed size collection of elements.</p>
<p>In the preprocessor library, tuples are represented like macro parameter
lists. Thus an element of a tuple can be any sequence of tokens that
constitutes a single macro parameter.</p>
<p>Examples of tuples:</p>
<pre>
(const, volatile) // 2-tuple
(*, /, %) // 3-tuple
(1, "2", '3', (4,5)) // 4-tuple
</pre>
<p>Tuples can be used for representing structured data.</p>
<hr>
<a href="stringize.htm">Prev</a> <a href="tuple_eat.htm">Next</a> <a href="index.htm#Macros">Macros</a> <a href="index.htm#Headers">Headers</a>

View File

@ -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>

View File

@ -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>
@ -37,16 +37,6 @@
<p>expands to <code>B</code>.</p>
<p>Tuples can be used for representing structured data.</p>
<p>Examples of tuples:</p>
<pre>
2-tuple: (A, B)
3-tuple: (1, 2, 3)
4-tuple: (A B C, D, EF, 34)
</pre>
<h3>See</h3>
<ul>
<li><a href="limits.htm#BOOST_PP_LIMIT_TUPLE">BOOST_PP_LIMIT_TUPLE</a></li>
@ -54,10 +44,6 @@
<hr>
<h2><a name="BOOST_PREPROCESSOR_TUPLE_ELEM">#define BOOST_PREPROCESSOR_TUPLE_ELEM</a>(N,I,T)</h2>
<p>Obsolete. Use <a href="tuple_elem.htm#BOOST_PP_TUPLE_ELEM">BOOST_PP_TUPLE_ELEM</a>().</p>
<hr>
<a href="tuple_eat.htm">Prev</a> <a href="tuple_reverse.htm">Next</a> <a href="index.htm#Macros">Macros</a> <a href="index.htm#Headers">Headers</a>
<hr>

View File

@ -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>

View File

@ -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>

View File

@ -26,29 +26,43 @@
<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 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>
<pre>
(3,3)
</pre>
<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
<a href="while.htm#BOOST_PP_WHILE">BOOST_PP_WHILE</a>(), there is a version of the macro, distinguished by the
D suffix (e.g. BOOST_PP_ADD_D()), that accepts an additional recursion
D suffix (e.g. <a href="arithmetic_add.htm#BOOST_PP_ADD_D">BOOST_PP_ADD_D</a>()), 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>

63
example/duffs_device.c Normal file
View File

@ -0,0 +1,63 @@
/* Copyright (C) 2002
* Housemarque Oy
* http://www.housemarque.com
*
* Permission to copy, use, modify, sell and distribute this software is
* granted provided this copyright notice appears in all copies. This
* software is provided "as is" without express or implied warranty, and
* with no claim as to its suitability for any purpose.
*
* See http://www.boost.org for most recent version.
*/
/* This example uses the preprocessor library to implement a generalized
* macro for implementing a Duff's Device.
*
* This example was inspired by an original generalized macro for
* implementing Duff's Device written by Joerg Walter.
*/
#include <boost/preprocessor/repeat.hpp>
#include <boost/preprocessor/tuple/elem.hpp>
#include <assert.h>
/* Expands to a Duff's Device. */
#define DUFFS_DEVICE(UNROLLING_FACTOR,COUNTER_TYPE,N,STATEMENT)\
do\
{\
COUNTER_TYPE duffs_device_initial_cnt = (N);\
if (duffs_device_initial_cnt > 0)\
{\
COUNTER_TYPE duffs_device_running_cnt = (duffs_device_initial_cnt + (UNROLLING_FACTOR-1))/UNROLLING_FACTOR;\
switch (duffs_device_initial_cnt % UNROLLING_FACTOR)\
{\
do\
{\
BOOST_PP_REPEAT(UNROLLING_FACTOR,DUFFS_DEVICE_C,(UNROLLING_FACTOR,{STATEMENT}))\
} while (--duffs_device_running_cnt);\
}\
}\
} while (0)
#define DUFFS_DEVICE_C(I,UNROLLING_FACTOR_STATEMENT)\
case (I?BOOST_PP_TUPLE_ELEM(2,0,UNROLLING_FACTOR_STATEMENT)-I:0): BOOST_PP_TUPLE_ELEM(2,1,UNROLLING_FACTOR_STATEMENT);
#ifndef UNROLLING_FACTOR
#define UNROLLING_FACTOR 16
#endif
#ifndef N
#define N 1000
#endif
int main(void)
{
int i=0;
DUFFS_DEVICE(UNROLLING_FACTOR, int, 0, ++i;);
assert(i == 0);
DUFFS_DEVICE(UNROLLING_FACTOR, int, N, ++i;);
assert(i == N);
return 0;
}

View File

@ -29,8 +29,8 @@
#include <boost/preprocessor/logical.hpp>
#include <boost/preprocessor/max.hpp>
#include <boost/preprocessor/min.hpp>
#include <boost/preprocessor/repeat.hpp>
#include <boost/preprocessor/repeat_2nd.hpp>
#include <boost/preprocessor/repeat_3rd.hpp>
#include <boost/preprocessor/repeat_from_to.hpp>
#include <boost/preprocessor/repeat_from_to_2nd.hpp>
#include <boost/preprocessor/repeat_from_to_3rd.hpp>
#include <boost/preprocessor/stringize.hpp>
#endif

View File

@ -20,6 +20,9 @@
/** <p>Expands to the sum of <code>X</code> and <code>Y</code>.</p>
<p>Both <code>X</code> and <code>Y</code> must expand to integer literals
in the range [0, BOOST_PP_LIMIT_MAG].</p>
<p>For example, <code>BOOST_PP_ADD(4,3)</code> expands to <code>7</code> (a
single token).</p>
@ -35,17 +38,16 @@ single token).</p>
*/
#define BOOST_PP_ADD(X,Y) BOOST_PP_ADD_D(0,X,Y)
#ifndef DOXYGEN_SHOULD_SKIP_THIS
/** <p>Can be used inside BOOST_PP_WHILE().</p> */
#define BOOST_PP_ADD_D(D,X,Y) BOOST_PP_TUPLE_ELEM(2,0,BOOST_PP_WHILE##D(BOOST_PP_ADD_C,BOOST_PP_ADD_F,(X,Y)))
#if !defined(BOOST_NO_COMPILER_CONFIG) && defined(__MWERKS__) && __MWERKS__ <= 0x2406
#if !defined(BOOST_NO_COMPILER_CONFIG) && defined(__MWERKS__)
# define BOOST_PP_ADD_C(D,P) BOOST_PP_TUPLE_ELEM(2,1,P)
# define BOOST_PP_ADD_F(D,P) (BOOST_PP_INC(BOOST_PP_TUPLE_ELEM(2,0,P)),BOOST_PP_DEC(BOOST_PP_TUPLE_ELEM(2,1,P)))
#else
# define BOOST_PP_ADD_C(D,P) BOOST_PP_TUPLE2_ELEM1 P
# define BOOST_PP_ADD_F(D,P) (BOOST_PP_INC(BOOST_PP_TUPLE2_ELEM0 P),BOOST_PP_DEC(BOOST_PP_TUPLE2_ELEM1 P))
#endif
#endif
/** <p>Obsolete. Use BOOST_PP_ADD().</p> */
/* <p>Obsolete. Use BOOST_PP_ADD().</p> */
#define BOOST_PREPROCESSOR_ADD(X,Y) BOOST_PP_ADD(X,Y)
#endif

View File

@ -18,6 +18,9 @@
/** <p>Expands to the quotient of <code>X</code> and <code>Y</code>.</p>
<p>Both <code>X</code> and <code>Y</code> must expand to integer literals
in the range [0, BOOST_PP_LIMIT_MAG].</p>
<p>For example, <code>BOOST_PP_DIV(4,3)</code> expands to <code>1</code> (a
single token).</p>
@ -33,17 +36,16 @@ single token).</p>
*/
#define BOOST_PP_DIV(X,Y) BOOST_PP_DIV_D(0,X,Y)
#ifndef DOXYGEN_SHOULD_SKIP_THIS
/** <p>Can be used inside BOOST_PP_WHILE().</p> */
#define BOOST_PP_DIV_D(D,X,Y) BOOST_PP_TUPLE_ELEM(3,0,BOOST_PP_WHILE##D(BOOST_PP_DIV_C,BOOST_PP_DIV_F,(0,X,Y)))
#if !defined(BOOST_NO_COMPILER_CONFIG) && defined(__MWERKS__) && __MWERKS__ <= 0x2406
#if !defined(BOOST_NO_COMPILER_CONFIG) && defined(__MWERKS__)
# define BOOST_PP_DIV_C(D,P) BOOST_PP_LESS_EQUAL_D(D,BOOST_PP_TUPLE_ELEM(3,2,P),BOOST_PP_TUPLE_ELEM(3,1,P))
# define BOOST_PP_DIV_F(D,P) (BOOST_PP_INC(BOOST_PP_TUPLE_ELEM(3,0,P)),BOOST_PP_SUB_D(D,BOOST_PP_TUPLE_ELEM(3,1,P),BOOST_PP_TUPLE_ELEM(3,2,P)),BOOST_PP_TUPLE_ELEM(3,2,P))
#else
# define BOOST_PP_DIV_C(D,P) BOOST_PP_LESS_EQUAL_D(D,BOOST_PP_TUPLE3_ELEM2 P,BOOST_PP_TUPLE3_ELEM1 P)
# define BOOST_PP_DIV_F(D,P) (BOOST_PP_INC(BOOST_PP_TUPLE3_ELEM0 P),BOOST_PP_SUB_D(D,BOOST_PP_TUPLE3_ELEM1 P,BOOST_PP_TUPLE3_ELEM2 P),BOOST_PP_TUPLE3_ELEM2 P)
#endif
#endif
/** <p>Obsolete. Use BOOST_PP_DIV().</p> */
/* <p>Obsolete. Use BOOST_PP_DIV().</p> */
#define BOOST_PREPROCESSOR_DIV(X,Y) BOOST_PP_DIV(X,Y)
#endif

View File

@ -17,6 +17,9 @@
/** <p>Expands to the remainder of <code>X</code> and <code>Y</code>.</p>
<p>Both <code>X</code> and <code>Y</code> must expand to integer literals
in the range [0, BOOST_PP_LIMIT_MAG].</p>
<p>For example, <code>BOOST_PP_MOD(4,3)</code> expands to <code>1</code> (a
single token).</p>
@ -32,12 +35,11 @@ single token).</p>
*/
#define BOOST_PP_MOD(X,Y) BOOST_PP_MOD_D(0,X,Y)
#ifndef DOXYGEN_SHOULD_SKIP_THIS
/** <p>Can be used inside BOOST_PP_WHILE().</p> */
#define BOOST_PP_MOD_D(D,X,Y) BOOST_PP_TUPLE_ELEM(2,0,BOOST_PP_WHILE##D(BOOST_PP_MOD_C,BOOST_PP_MOD_F,(X,Y)))
#define BOOST_PP_MOD_C(D,P) BOOST_PP_LESS_EQUAL_D(D,BOOST_PP_TUPLE2_ELEM1 P,BOOST_PP_TUPLE2_ELEM0 P)
#define BOOST_PP_MOD_F(D,P) (BOOST_PP_SUB_D(D,BOOST_PP_TUPLE2_ELEM0 P,BOOST_PP_TUPLE2_ELEM1 P),BOOST_PP_TUPLE2_ELEM1 P)
#endif
/** <p>Obsolete. Use BOOST_PP_MOD().</p> */
/* <p>Obsolete. Use BOOST_PP_MOD().</p> */
#define BOOST_PREPROCESSOR_MOD(X,Y) BOOST_PP_MOD(X,Y)
#endif

View File

@ -17,6 +17,9 @@
/** <p>Expands to the product of <code>X</code> and <code>Y</code>.</p>
<p>Both <code>X</code> and <code>Y</code> must expand to integer literals
in the range [0, BOOST_PP_LIMIT_MAG].</p>
<p>For example, <code>BOOST_PP_MUL(4,3)</code> expands to <code>12</code> (a
single token).</p>
@ -32,17 +35,16 @@ single token).</p>
*/
#define BOOST_PP_MUL(X,Y) BOOST_PP_MUL_D(0,X,Y)
#ifndef DOXYGEN_SHOULD_SKIP_THIS
/** <p>Can be used inside BOOST_PP_WHILE().</p> */
#define BOOST_PP_MUL_D(D,X,Y) BOOST_PP_TUPLE_ELEM(3,0,BOOST_PP_WHILE##D(BOOST_PP_MUL_C,BOOST_PP_MUL_F,(0,X,Y)))
#if !defined(BOOST_NO_COMPILER_CONFIG) && defined(__MWERKS__) && __MWERKS__ <= 0x2406
#if !defined(BOOST_NO_COMPILER_CONFIG) && defined(__MWERKS__)
# define BOOST_PP_MUL_C(D,P) BOOST_PP_TUPLE_ELEM(3,2,P)
# define BOOST_PP_MUL_F(D,P) (BOOST_PP_ADD_D(D,BOOST_PP_TUPLE_ELEM(3,0,P),BOOST_PP_TUPLE_ELEM(3,1,P)),BOOST_PP_TUPLE_ELEM(3,1,P),BOOST_PP_DEC(BOOST_PP_TUPLE_ELEM(3,2,P)))
#else
# define BOOST_PP_MUL_C(D,P) BOOST_PP_TUPLE3_ELEM2 P
# define BOOST_PP_MUL_F(D,P) (BOOST_PP_ADD_D(D,BOOST_PP_TUPLE3_ELEM0 P,BOOST_PP_TUPLE3_ELEM1 P),BOOST_PP_TUPLE3_ELEM1 P,BOOST_PP_DEC(BOOST_PP_TUPLE3_ELEM2 P))
#endif
#endif
/** <p>Obsolete. Use BOOST_PP_MUL().</p> */
/* <p>Obsolete. Use BOOST_PP_MUL().</p> */
#define BOOST_PREPROCESSOR_MUL(X,Y) BOOST_PP_MUL(X,Y)
#endif

View File

@ -19,6 +19,9 @@
/** <p>Expands to the difference of <code>X</code> and <code>Y</code>.</p>
<p>Both <code>X</code> and <code>Y</code> must expand to integer literals
in the range [0, BOOST_PP_LIMIT_MAG].</p>
<p>For example, <code>BOOST_PP_SUB(4,3)</code> expands to <code>1</code> (a
single token).</p>
@ -34,17 +37,16 @@ single token).</p>
*/
#define BOOST_PP_SUB(X,Y) BOOST_PP_SUB_D(0,X,Y)
#ifndef DOXYGEN_SHOULD_SKIP_THIS
/** <p>Can be used inside BOOST_PP_WHILE().</p> */
#define BOOST_PP_SUB_D(D,X,Y) BOOST_PP_TUPLE_ELEM(2,0,BOOST_PP_WHILE##D(BOOST_PP_SUB_C,BOOST_PP_SUB_F,(X,Y)))
#if !defined(BOOST_NO_COMPILER_CONFIG) && defined(__MWERKS__) && __MWERKS__ <= 0x2406
#if !defined(BOOST_NO_COMPILER_CONFIG) && defined(__MWERKS__)
# define BOOST_PP_SUB_C(D,P) BOOST_PP_TUPLE_ELEM(2,1,P)
# define BOOST_PP_SUB_F(D,P) (BOOST_PP_DEC(BOOST_PP_TUPLE_ELEM(2,0,P)),BOOST_PP_DEC(BOOST_PP_TUPLE_ELEM(2,1,P)))
#else
# define BOOST_PP_SUB_C(D,P) BOOST_PP_TUPLE2_ELEM1 P
# define BOOST_PP_SUB_F(D,P) (BOOST_PP_DEC(BOOST_PP_TUPLE2_ELEM0 P),BOOST_PP_DEC(BOOST_PP_TUPLE2_ELEM1 P))
#endif
#endif
/** <p>Obsolete. Use BOOST_PP_SUB(X,Y).</p> */
/* <p>Obsolete. Use BOOST_PP_SUB(X,Y).</p> */
#define BOOST_PREPROCESSOR_SUB(X,Y) BOOST_PP_SUB(X,Y)
#endif

View File

@ -13,13 +13,18 @@
* See http://www.boost.org for most recent version.
*/
#include <boost/preprocessor/empty.hpp>
#include <boost/preprocessor/if.hpp>
#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> */
#define BOOST_PP_ASSERT_MSG(C,MSG) BOOST_PP_IF(C,BOOST_PP_EMPTY,MSG BOOST_PP_EMPTY)()
/** <p>Expands to nothing if <code>COND != 0</code> and to <code>MSG</code> if
<code>COND == 0</code>.</p>
/** <p>Obsolete. Use BOOST_PP_ASSERT_MSG().</p> */
<p><code>COND</code> must expand to an integer literal in the range [0, BOOST_PP_LIMIT_MAG].</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(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)
#endif

View File

@ -16,6 +16,8 @@
/** <p>Concatenates <code>X</code> and <code>Y</code> after they are macro
expanded.</p>
<p>For example, <code>BOOST_PP_CAT(A,BOOST_PP_CAT(_,B))</code> expands to <code>A_B</code>.</p>
<h3>Example</h3>
<ul>
<li><a href="../../example/static_assert.c">static_assert.c</a></li>
@ -28,11 +30,9 @@ expanded.</p>
*/
#define BOOST_PP_CAT(X,Y) BOOST_PP_CAT_DELAY(X,Y)
#ifndef DOXYGEN_SHOULD_SKIP_THIS
#define BOOST_PP_CAT_DELAY(X,Y) BOOST_PP_DO_CAT(X,Y)
#define BOOST_PP_DO_CAT(X,Y) X##Y
#endif
/** <p>Obsolete. Use BOOST_PP_CAT().</p> */
/* <p>Obsolete. Use BOOST_PP_CAT().</p> */
#define BOOST_PREPROCESSOR_CAT(X,Y) BOOST_PP_CAT(X,Y)
#endif

View File

@ -13,7 +13,18 @@
* See http://www.boost.org for most recent version.
*/
/** <p>Expands to a comma. Can be used with BOOST_PP_IF().</p>
/** <p>Expands to a comma.</p>
<p>Commas need special handling in preprocessor code, because commas are used
for separating macro parameters.</p>
<p>For example,</p>
<pre>
BOOST_PP_IF(1,BOOST_PP_COMMA,BOOST_PP_EMPTY)()
</pre>
<p>expands to a comma.</p>
<h3>See</h3>
<ul>
@ -22,6 +33,6 @@
*/
#define BOOST_PP_COMMA() ,
/** <p>Obsolete. Use BOOST_PP_COMMA().</p> */
/* <p>Obsolete. Use BOOST_PP_COMMA().</p> */
#define BOOST_PREPROCESSOR_COMMA() ,
#endif

View File

@ -17,11 +17,15 @@
#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>
*/
#define BOOST_PP_COMMA_IF(C) BOOST_PP_IF(C,BOOST_PP_COMMA,BOOST_PP_EMPTY)()
/** <p>Expands to a comma if <code>COND != 0</code> and nothing if
<code>COND == 0</code>.</p>
/** <p>Obsolete. Use BOOST_PP_COMMA_IF().</p> */
<p><code>COND</code> must expand to an integer literal in the range [0, BOOST_PP_LIMIT_MAG].</p>
<p>For example, <code>BOOST_PP_COMMA_IF(0)</code> expands to nothing.</p>
*/
#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)
#endif

View File

@ -19,6 +19,11 @@
/** <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
in the range [0, BOOST_PP_LIMIT_MAG].</p>
<p>For example, <code>BOOST_PP_EQUAL(4,4)</code> expands to <code>1</code>.</p>
<h3>Uses</h3>
<ul>
<li>BOOST_PP_WHILE()</li>
@ -31,10 +36,9 @@ otherwise.</p>
*/
#define BOOST_PP_EQUAL(X,Y) BOOST_PP_EQUAL_D(0,X,Y)
#ifndef DOXYGEN_SHOULD_SKIP_THIS
/** <p>Can be used inside BOOST_PP_WHILE().</p> */
#define BOOST_PP_EQUAL_D(D,X,Y) BOOST_PP_NOT(BOOST_PP_NOT_EQUAL_D(D,X,Y))
#endif
/** <p>Obsolete. Use BOOST_PP_EQUAL().</p> */
/* <p>Obsolete. Use BOOST_PP_EQUAL().</p> */
#define BOOST_PREPROCESSOR_EQUAL(X,Y) BOOST_PP_EQUAL(X,Y)
#endif

View File

@ -18,6 +18,11 @@
/** <p>Expands to <code>1</code> if <code>X &gt; Y</code> and <code>0</code>
otherwise.</p>
<p>Both <code>X</code> and <code>Y</code> must expand to integer literals
in the range [0, BOOST_PP_LIMIT_MAG].</p>
<p>For example, <code>BOOST_PP_GREATER(4,3)</code> expands to <code>1</code>.</p>
<h3>Uses</h3>
<ul>
<li>BOOST_PP_WHILE()</li>
@ -30,10 +35,9 @@ otherwise.</p>
*/
#define BOOST_PP_GREATER(X,Y) BOOST_PP_GREATER_D(0,X,Y)
#ifndef DOXYGEN_SHOULD_SKIP_THIS
/** <p>Can be used inside BOOST_PP_WHILE().</p> */
#define BOOST_PP_GREATER_D(D,X,Y) BOOST_PP_LESS_D(D,Y,X)
#endif
/** <p>Obsolete. Use BOOST_PP_GREATER().</p> */
/* <p>Obsolete. Use BOOST_PP_GREATER().</p> */
#define BOOST_PREPROCESSOR_GREATER(X,Y) BOOST_PP_GREATER(X,Y)
#endif

View File

@ -18,6 +18,11 @@
/** <p>Expands to <code>1</code> if <code>X &gt;= Y</code> and <code>0</code>
otherwise.</p>
<p>Both <code>X</code> and <code>Y</code> must expand to integer literals
in the range [0, BOOST_PP_LIMIT_MAG].</p>
<p>For example, <code>BOOST_PP_GREATER_EQUAL(1,3)</code> expands to <code>0</code>.</p>
<h3>Uses</h3>
<ul>
<li>BOOST_PP_WHILE()</li>
@ -30,10 +35,9 @@ otherwise.</p>
*/
#define BOOST_PP_GREATER_EQUAL(X,Y) BOOST_PP_GREATER_EQUAL_D(0,X,Y)
#ifndef DOXYGEN_SHOULD_SKIP_THIS
/** <p>Can be used inside BOOST_PP_WHILE().</p> */
#define BOOST_PP_GREATER_EQUAL_D(D,X,Y) BOOST_PP_LESS_EQUAL_D(D,Y,X)
#endif
/** <p>Obsolete. Use BOOST_PP_GREATER_EQUAL().</p> */
/* <p>Obsolete. Use BOOST_PP_GREATER_EQUAL().</p> */
#define BOOST_PREPROCESSOR_GREATER_EQUAL(X,Y) BOOST_PP_GREATER_EQUAL(X,Y)
#endif

View File

@ -20,6 +20,11 @@
/** <p>Expands to <code>1</code> if <code>X &lt; Y</code> and <code>0</code>
otherwise.</p>
<p>Both <code>X</code> and <code>Y</code> must expand to integer literals
in the range [0, BOOST_PP_LIMIT_MAG].</p>
<p>For example, <code>BOOST_PP_LESS(2,6)</code> expands to <code>1</code>.</p>
<h3>Uses</h3>
<ul>
<li>BOOST_PP_WHILE()</li>
@ -32,10 +37,9 @@ otherwise.</p>
*/
#define BOOST_PP_LESS(X,Y) BOOST_PP_LESS_D(0,X,Y)
#ifndef DOXYGEN_SHOULD_SKIP_THIS
/** <p>Can be used inside BOOST_PP_WHILE().</p> */
#define BOOST_PP_LESS_D(D,X,Y) BOOST_PP_AND(BOOST_PP_NOT_EQUAL_D(D,X,Y),BOOST_PP_LESS_EQUAL_D(D,X,Y))
#endif
/** <p>Obsolete. Use BOOST_PP_LESS().</p> */
/* <p>Obsolete. Use BOOST_PP_LESS().</p> */
#define BOOST_PREPROCESSOR_LESS(X,Y) BOOST_PP_LESS(X,Y)
#endif

View File

@ -19,6 +19,11 @@
/** <p>Expands to <code>1</code> if <code>X &lt;= Y</code> and <code>0</code>
otherwise.</p>
<p>Both <code>X</code> and <code>Y</code> must expand to integer literals
in the range [0, BOOST_PP_LIMIT_MAG].</p>
<p>For example, <code>BOOST_PP_LESS_EQUAL(7,5)</code> expands to <code>0</code>.</p>
<h3>Uses</h3>
<ul>
<li>BOOST_PP_WHILE()</li>
@ -31,10 +36,9 @@ otherwise.</p>
*/
#define BOOST_PP_LESS_EQUAL(X,Y) BOOST_PP_LESS_EQUAL_D(0,X,Y)
#ifndef DOXYGEN_SHOULD_SKIP_THIS
/** <p>Can be used inside BOOST_PP_WHILE().</p> */
#define BOOST_PP_LESS_EQUAL_D(D,X,Y) BOOST_PP_NOT(BOOST_PP_SUB_D(D,X,Y))
#endif
/** <p>Obsolete. Use BOOST_PP_LESS_EQUAL().</p> */
/* <p>Obsolete. Use BOOST_PP_LESS_EQUAL().</p> */
#define BOOST_PREPROCESSOR_LESS_EQUAL(X,Y) BOOST_PP_LESS_EQUAL(X,Y)
#endif

View File

@ -20,6 +20,11 @@
/** <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
in the range [0, BOOST_PP_LIMIT_MAG].</p>
<p>For example, <code>BOOST_PP_NOT_EQUAL(4,4)</code> expands to <code>0</code>.</p>
<h3>Uses</h3>
<ul>
<li>BOOST_PP_WHILE()</li>
@ -32,10 +37,9 @@ otherwise.</p>
*/
#define BOOST_PP_NOT_EQUAL(X,Y) BOOST_PP_NOT_EQUAL_D(0,X,Y)
#ifndef DOXYGEN_SHOULD_SKIP_THIS
/** <p>Can be used inside BOOST_PP_WHILE().</p> */
#define BOOST_PP_NOT_EQUAL_D(D,X,Y) BOOST_PP_BOOL(BOOST_PP_ADD_D(D,BOOST_PP_SUB_D(D,X,Y),BOOST_PP_SUB_D(D,Y,X)))
#endif
/** <p>Obsolete. Use BOOST_PP_NOT_EQUAL().</p> */
/* <p>Obsolete. Use BOOST_PP_NOT_EQUAL().</p> */
#define BOOST_PREPROCESSOR_NOT_EQUAL(X,Y) BOOST_PP_NOT_EQUAL(X,Y)
#endif

View File

@ -25,7 +25,6 @@ supported.</p>
*/
#define BOOST_PP_DEC(X) BOOST_PP_DEC_DELAY(X)
#ifndef DOXYGEN_SHOULD_SKIP_THIS
#define BOOST_PP_DEC_DELAY(X) BOOST_PP_DEC##X
#define BOOST_PP_DEC0 0
#define BOOST_PP_DEC1 0
@ -156,8 +155,7 @@ supported.</p>
#define BOOST_PP_DEC126 125
#define BOOST_PP_DEC127 126
#define BOOST_PP_DEC128 127
#endif
/** <p>Obsolete. Use BOOST_PP_DEC().</p> */
/* <p>Obsolete. Use BOOST_PP_DEC().</p> */
#define BOOST_PREPROCESSOR_DEC(X) BOOST_PP_DEC(X)
#endif

View File

@ -13,7 +13,15 @@
* See http://www.boost.org for most recent version.
*/
/** <p>Expands to nothing. Used with BOOST_PP_IF() and as an unused parameter.</p>
/** <p>Expands to nothing.</p>
<p>For example,</p>
<pre>
BOOST_PP_IF(0,BOOST_PP_COMMA,BOOST_PP_EMPTY)()
</pre>
<p>expands to nothing.</p>
<h3>Example</h3>
<ul>
@ -27,6 +35,6 @@
*/
#define BOOST_PP_EMPTY()
/** <p>Obsolete. Use BOOST_PP_EMPTY().</p> */
/* <p>Obsolete. Use BOOST_PP_EMPTY().</p> */
#define BOOST_PREPROCESSOR_EMPTY()
#endif

View File

@ -22,7 +22,21 @@
<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(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>
<p>expands to:</p>
<pre>
X0 x0, X1 x1, X2 x2
</pre>
<h3>Uses</h3>
@ -35,13 +49,11 @@
<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))
#ifndef DOXYGEN_SHOULD_SKIP_THIS
#if !defined(BOOST_NO_COMPILER_CONFIG) && defined(__MWERKS__) && __MWERKS__ <= 0x2406
#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))
#else
# define BOOST_PP_ENUM_F(I,FP) BOOST_PP_COMMA_IF(I) BOOST_PP_TUPLE2_ELEM0 FP(I,BOOST_PP_TUPLE2_ELEM1 FP)
#endif
#endif
#endif

View File

@ -21,7 +21,19 @@
<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>
<pre>
BOOST_PP_ENUM_PARAMS(3,x)
</pre>
<p>expands to:</p>
<pre>
x0, x1, x2
</pre>
<h3>Uses</h3>
@ -34,12 +46,10 @@
<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)
#ifndef DOXYGEN_SHOULD_SKIP_THIS
#define BOOST_PP_ENUM_PARAMS_F(I,P) BOOST_PP_CAT(P,I)
#endif
/** <p>Obsolete. Use BOOST_PP_ENUM_PARAMS().</p> */
/* <p>Obsolete. Use BOOST_PP_ENUM_PARAMS().</p> */
#define BOOST_PREPROCESSOR_ENUM_PARAMS(N,P) BOOST_PP_ENUM_PARAMS(N,P)
#endif

View File

@ -21,7 +21,22 @@
<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>
<pre>
BOOST_PP_ENUM_PARAMS_WITH_A_DEFAULT(3,x,y)
</pre>
<p>expands to:</p>
<pre>
x0 = y, x1 = y, x2 = y
</pre>
<h3>Uses</h3>
@ -34,16 +49,14 @@
<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))
#ifndef DOXYGEN_SHOULD_SKIP_THIS
#if !defined(BOOST_NO_COMPILER_CONFIG) && defined(__MWERKS__) && __MWERKS__ <= 0x2406
#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)
#else
# define BOOST_PP_ENUM_PARAMS_WITH_A_DEFAULT_F(I,PD) BOOST_PP_CAT(BOOST_PP_TUPLE2_ELEM0 PD,I)=BOOST_PP_TUPLE2_ELEM1 PD
#endif
#endif
/** <p>Obsolete. Use BOOST_PP_ENUM_PARAMS_WITH_A_DEFAULT().</p> */
/* <p>Obsolete. Use BOOST_PP_ENUM_PARAMS_WITH_A_DEFAULT().</p> */
#define BOOST_PREPROCESSOR_ENUM_PARAMS_WITH_A_DEFAULT(N,P,D) BOOST_PP_ENUM_PARAMS_WITH_A_DEFAULT(N,P,D)
#endif

View File

@ -21,10 +21,22 @@
<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>
<pre>
BOOST_PP_ENUM_PARAMS_WITH_DEFAULTS(3,x,y)
</pre>
<p>expands to:</p>
<pre>
x0 = y0, x1 = y1, x2 = y2
</pre>
<h3>Uses</h3>
@ -37,16 +49,14 @@
<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))
#ifndef DOXYGEN_SHOULD_SKIP_THIS
#if !defined(BOOST_NO_COMPILER_CONFIG) && defined(__MWERKS__) && __MWERKS__ <= 0x2406
#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)
#else
# define BOOST_PP_ENUM_PARAMS_WITH_DEFAULTS_F(I,PD) BOOST_PP_CAT(BOOST_PP_TUPLE2_ELEM0 PD,I)=BOOST_PP_CAT(BOOST_PP_TUPLE2_ELEM1 PD,I)
#endif
#endif
/** <p>Obsolete. Use BOOST_PP_ENUM_PARAMS_WITH_DEFAULTS().</p> */
/* <p>Obsolete. Use BOOST_PP_ENUM_PARAMS_WITH_DEFAULTS().</p> */
#define BOOST_PREPROCESSOR_ENUM_PARAMS_WITH_DEFAULTS(N,P,D) BOOST_PP_ENUM_PARAMS_WITH_DEFAULTS(N,P,D)
#endif

View File

@ -22,7 +22,21 @@
<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(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>
<p>expands to:</p>
<pre>
X1 x1, X2 x2
</pre>
<h3>Uses</h3>
@ -30,13 +44,11 @@
<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))
#ifndef DOXYGEN_SHOULD_SKIP_THIS
#if !defined(BOOST_NO_COMPILER_CONFIG) && defined(__MWERKS__) && __MWERKS__ <= 0x2406
#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))
#else
# define BOOST_PP_ENUM_SHIFTED_F(I,FP) BOOST_PP_TUPLE2_ELEM0 FP(BOOST_PP_INC(I),BOOST_PP_TUPLE2_ELEM1 FP)
#endif
#endif
#endif

View File

@ -21,7 +21,18 @@
<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>
<pre>
BOOST_PP_ENUM_SHIFTED_PARAMS(3,x)
</pre>
<p>expands to:</p>
<pre>
x1, x2
</pre>
<h3>Uses</h3>
@ -40,12 +51,10 @@
<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)
#ifndef DOXYGEN_SHOULD_SKIP_THIS
#define BOOST_PP_ENUM_SHIFTED_PARAMS_F(I,P) BOOST_PP_CAT(P,I)
#endif
/** <p>Obsolete. Use BOOST_PP_ENUM_SHIFTED_PARAMS().</p> */
/* <p>Obsolete. Use BOOST_PP_ENUM_SHIFTED_PARAMS().</p> */
#define BOOST_PREPROCESSOR_ENUM_SHIFTED_PARAMS(N,P) BOOST_PP_ENUM_SHIFTED_PARAMS(N,P)
#endif

Some files were not shown because too many files have changed in this diff Show More