mirror of
https://github.com/boostorg/preprocessor.git
synced 2025-07-15 21:42:08 +02:00
initial revision
[SVN r15198]
This commit is contained in:
58
docs.1/ref/add.html
Normal file
58
docs.1/ref/add.html
Normal file
@ -0,0 +1,58 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>BOOST_PP_ADD</title>
|
||||
<link rel="stylesheet" type="text/css" href="../styles.css">
|
||||
<script language="javascript" type="text/javascript" src="../scripts.js"></script>
|
||||
</head>
|
||||
<body onload="init('sample');">
|
||||
<div style="margin-left: 0px;">
|
||||
The <b>BOOST_PP_ADD</b> macro expands to the sum of its arguments.
|
||||
</div>
|
||||
<h4>Usage</h4>
|
||||
<div class="code">
|
||||
<b>BOOST_PP_ADD</b>(<i>x</i>, <i>y</i>)
|
||||
</div>
|
||||
<h4>Arguments</h4>
|
||||
<dl>
|
||||
<dt>x</dt>
|
||||
<dd>
|
||||
The first addend of the operation.
|
||||
Valid values range from <i>0</i> to <b>BOOST_PP_LIMIT_MAG</b>.
|
||||
</dd>
|
||||
<dt>y</dt>
|
||||
<dd>
|
||||
The second addend of the operation.
|
||||
Valid values range from <i>0</i> to <b>BOOST_PP_LIMIT_MAG</b>.
|
||||
</dd>
|
||||
</dl>
|
||||
<h4>Remarks</h4>
|
||||
<div>
|
||||
If the sum of <i>x</i> and <i>y</i> is greater than <b>BOOST_PP_LIMIT_MAG</b>, the result is saturated to <b>BOOST_PP_LIMIT_MAG</b>.
|
||||
</div>
|
||||
<div>
|
||||
Previously, this macro could not be used inside <b>BOOST_PP_WHILE</b>.
|
||||
There is no longer any such restriction.
|
||||
It is more efficient, however, to use <b>BOOST_PP_ADD_D</b> in such a situation.
|
||||
</div>
|
||||
<div>
|
||||
This macro is the most efficient when <i>x</i> is less than or equal to <i>y</i>.
|
||||
However, the efficiency gain is not worth actually comparing the two arguments prior to invocation.
|
||||
In other words, <i>x</i> should be the addend that is <i>most likely</i> to be the largest of the two operands.
|
||||
</div>
|
||||
<h4>See Also</h4>
|
||||
<ul>
|
||||
<li><a href="add_d.html">BOOST_PP_ADD_D</a></li>
|
||||
<li><a href="limit_mag.html">BOOST_PP_LIMIT_MAG</a></li>
|
||||
</ul>
|
||||
<h4>Requirements</h4>
|
||||
<div>
|
||||
<b>Header:</b> <a href="../headers/arithmetic/add.hpp.html"><boost/preprocessor/arithmetic/add.hpp></a>
|
||||
</div>
|
||||
<h4><a class="local" onclick="toggle('sample');" onmouseover="change(this);" onmouseout="revert(this);">Sample Code</a></h4>
|
||||
<div id="sample"><pre>
|
||||
#include <boost/preprocessor/arithmetic/add.hpp>
|
||||
|
||||
BOOST_PP_ADD(4, 3) // expands to 7
|
||||
<pre></div>
|
||||
</body>
|
||||
</html>
|
80
docs.1/ref/add_d.html
Normal file
80
docs.1/ref/add_d.html
Normal file
@ -0,0 +1,80 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>BOOST_PP_ADD_D</title>
|
||||
<link rel="stylesheet" type="text/css" href="../styles.css">
|
||||
<script language="javascript" type="text/javascript" src="../scripts.js"></script>
|
||||
</head>
|
||||
<body onload="init('sample');">
|
||||
<div style="margin-left: 0px;">
|
||||
The <b>BOOST_PP_ADD_D</b> macro expands to the sum of its second and third arguments.
|
||||
It reenters <b>BOOST_PP_WHILE</b> with maximum efficiency.
|
||||
</div>
|
||||
<h4>Usage</h4>
|
||||
<div class="code">
|
||||
<b>BOOST_PP_ADD_D</b>(<i>d</i>, <i>x</i>, <i>y</i>)
|
||||
</div>
|
||||
<h4>Arguments</h4>
|
||||
<dl>
|
||||
<dt>d</dt>
|
||||
<dd>
|
||||
The next available <b>BOOST_PP_WHILE</b> iteration.
|
||||
</dd>
|
||||
<dt>x</dt>
|
||||
<dd>
|
||||
The first addend of the operation.
|
||||
Valid values range from <i>0</i> to <b>BOOST_PP_LIMIT_MAG</b>.
|
||||
</dd>
|
||||
<dt>y</dt>
|
||||
<dd>
|
||||
The second addend of the operation.
|
||||
Valid values range from <i>0</i> to <b>BOOST_PP_LIMIT_MAG</b>.
|
||||
</dd>
|
||||
</dl>
|
||||
<h4>Remarks</h4>
|
||||
<div>
|
||||
If the sum of <i>x</i> and <i>y</i> is greater than <b>BOOST_PP_LIMIT_MAG</b>, the result is saturated to <b>BOOST_PP_LIMIT_MAG</b>.
|
||||
</div>
|
||||
<div>
|
||||
This macro is the most efficient when <i>x</i> is less than or equal to <i>y</i>.
|
||||
However, the efficiency gain is not worth actually comparing the two arguments prior to invocation.
|
||||
In other words, <i>x</i> should be the addend that is <i>most likely</i> to be the largest of the two operands.
|
||||
</div>
|
||||
<h4>See Also</h4>
|
||||
<ul>
|
||||
<li><a href="add.html">BOOST_PP_ADD</a></li>
|
||||
<li><a href="limit_mag.html">BOOST_PP_LIMIT_MAG</a></li>
|
||||
</ul>
|
||||
<h4>Requirements</h4>
|
||||
<div>
|
||||
<b>Header:</b> <a href="../headers/arithmetic/add.hpp.html"><boost/preprocessor/arithmetic/add.hpp></a>
|
||||
</div>
|
||||
<h4><a class="local" onclick="toggle('sample');" onmouseover="change(this);" onmouseout="revert(this);">Sample Code</a></h4>
|
||||
<div id="sample"><pre>
|
||||
#include <boost/preprocessor/arithmetic/add.hpp>
|
||||
#include <boost/preprocessor/arithmetic/dec.hpp>
|
||||
#include <boost/preprocessor/control/while.hpp>
|
||||
#include <boost/preprocessor/tuple/elem.hpp>
|
||||
|
||||
#define PRED(d, data) BOOST_PP_TUPLE_ELEM(2, 0, data)
|
||||
|
||||
#define OP(d, data) /* ............... */ \
|
||||
( \
|
||||
BOOST_PP_DEC( \
|
||||
BOOST_PP_TUPLE_ELEM(2, 0, data) \
|
||||
), \
|
||||
BOOST_PP_ADD_D( \
|
||||
d, \
|
||||
BOOST_PP_TUPLE_ELEM(2, 1, data), \
|
||||
2 \
|
||||
) \
|
||||
) \
|
||||
/**/
|
||||
|
||||
// increment 'x' by 2 'n' times
|
||||
#define STRIDE(x, n) BOOST_PP_TUPLE_ELEM(2, 1, BOOST_PP_WHILE(PRED, OP, (n, x)))
|
||||
|
||||
STRIDE(10, 2) // expands to 14
|
||||
STRIDE(51, 6) // expands to 63
|
||||
<pre></div>
|
||||
</body>
|
||||
</html>
|
54
docs.1/ref/and.html
Normal file
54
docs.1/ref/and.html
Normal file
@ -0,0 +1,54 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>BOOST_PP_AND</title>
|
||||
<link rel="stylesheet" type="text/css" href="../styles.css">
|
||||
<script language="javascript" type="text/javascript" src="../scripts.js"></script>
|
||||
</head>
|
||||
<body onload="init('sample');">
|
||||
<div style="margin-left: 0px;">
|
||||
The <b>BOOST_PP_AND</b> macro expands to the logical <i>AND</i> of its operands.
|
||||
</div>
|
||||
<h4>Usage</h4>
|
||||
<div class="code">
|
||||
<b>BOOST_PP_AND</b>(<i>p</i>, <i>q</i>)
|
||||
</div>
|
||||
<h4>Arguments</h4>
|
||||
<dl>
|
||||
<dt>p</dt>
|
||||
<dd>
|
||||
The left operand of the operation.
|
||||
Valid values range from <i>0</i> to <b>BOOST_PP_LIMIT_MAG</b>.
|
||||
</dd>
|
||||
<dt>q</dt>
|
||||
<dd>
|
||||
The right operand of the operation.
|
||||
Valid values range from <i>0</i> to <b>BOOST_PP_LIMIT_MAG</b>.
|
||||
</dd>
|
||||
</dl>
|
||||
<h4>Remarks</h4>
|
||||
<div>
|
||||
If both <i>p</i> and <i>q</i> are non-zero, this macro expands to <i>1</i>.
|
||||
Otherwise, it expands to <i>0</i>.
|
||||
</div>
|
||||
<div>
|
||||
This macro performs a boolean conversion on each operand before performing the logical <i>AND</i> operation.
|
||||
If that conversion is not necessary, use <b>BOOST_PP_BITAND</b> instead.
|
||||
</div>
|
||||
<h4>See Also</h4>
|
||||
<ul>
|
||||
<li><a href="bitand.html">BOOST_PP_BITAND</a></li>
|
||||
<li><a href="limit_mag.html">BOOST_PP_LIMIT_MAG</a></li>
|
||||
</ul>
|
||||
<h4>Requirements</h4>
|
||||
<div>
|
||||
<b>Header:</b> <a href="../headers/logical/and.hpp.html"><boost/preprocessor/logical/and.hpp></a>
|
||||
</div>
|
||||
<h4><a class="local" onclick="toggle('sample');" onmouseover="change(this);" onmouseout="revert(this);">Sample Code</a></h4>
|
||||
<div id="sample"><pre>
|
||||
#include <boost/preprocessor/logical/and.hpp>
|
||||
|
||||
BOOST_PP_AND(4, 3) // expands to 1
|
||||
BOOST_PP_AND(5, 0) // expands to 0
|
||||
<pre></div>
|
||||
</body>
|
||||
</html>
|
54
docs.1/ref/apply.html
Normal file
54
docs.1/ref/apply.html
Normal file
@ -0,0 +1,54 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>BOOST_PP_APPLY</title>
|
||||
<link rel="stylesheet" type="text/css" href="../styles.css">
|
||||
<script language="javascript" type="text/javascript" src="../scripts.js"></script>
|
||||
</head>
|
||||
<body onload="init('sample');">
|
||||
<div style="margin-left: 0px;">
|
||||
The <b>BOOST_PP_APPLY</b> macro abstracts the difference between an argument and nothing.
|
||||
</div>
|
||||
<h4>Usage</h4>
|
||||
<div class="code">
|
||||
<b>BOOST_PP_APPLY</b>(<i>x</i>)
|
||||
</div>
|
||||
<h4>Arguments</h4>
|
||||
<dl>
|
||||
<dt>x</dt>
|
||||
<dd>
|
||||
The abstracted argument.
|
||||
This argument must be either <b>BOOST_PP_NIL</b> or a <i>tuple</i> with one element--such as <i>(arg)</i> or <i>((a, b))</i>.
|
||||
</dd>
|
||||
</dl>
|
||||
<h4>Remarks</h4>
|
||||
<div>
|
||||
If <i>x</i> is <b>BOOST_PP_NIL</b>, this macro expands to nothing.
|
||||
If <i>x</i> is a one element <i>tuple</i>, it expands to the contents of that <i>tuple</i>.
|
||||
</div>
|
||||
<h4>See Also</h4>
|
||||
<ul>
|
||||
<li><a href="nil.html">BOOST_PP_NIL</a></li>
|
||||
</ul>
|
||||
<h4>Requirements</h4>
|
||||
<div>
|
||||
<b>Header:</b> <a href="../headers/facilities/apply.hpp.html"><boost/preprocessor/facilities/apply.hpp></a>
|
||||
</div>
|
||||
<h4><a class="local" onclick="toggle('sample');" onmouseover="change(this);" onmouseout="revert(this);">Sample Code</a></h4>
|
||||
<div id="sample"><pre>
|
||||
#include <boost/preprocessor/facilities/apply.hpp>
|
||||
#include <boost/preprocessor/tuple/elem.hpp>
|
||||
|
||||
#define CV(i) /* .......................................... */ \
|
||||
BOOST_PP_APPLY( \
|
||||
BOOST_PP_TUPLE_ELEM( \
|
||||
4, i, \
|
||||
(BOOST_PP_NIL, (const), (volatile), (const volatile)) \
|
||||
) \
|
||||
) \
|
||||
/**/
|
||||
|
||||
CV(0) // expands to nothing
|
||||
CV(1) // expands to const
|
||||
<pre></div>
|
||||
</body>
|
||||
</html>
|
39
docs.1/ref/array_data.html
Normal file
39
docs.1/ref/array_data.html
Normal file
@ -0,0 +1,39 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>BOOST_PP_ARRAY_DATA</title>
|
||||
<link rel="stylesheet" type="text/css" href="../styles.css">
|
||||
<script language="javascript" type="text/javascript" src="../scripts.js"></script>
|
||||
</head>
|
||||
<body onload="init('sample');">
|
||||
<div style="margin-left: 0px;">
|
||||
The <b>BOOST_PP_ARRAY_DATA</b> macro extracts the <i>tuple</i> data from an <i>array</i>.
|
||||
</div>
|
||||
<h4>Usage</h4>
|
||||
<div class="code">
|
||||
<b>BOOST_PP_ARRAY_DATA</b>(<i>array</i>)
|
||||
</div>
|
||||
<h4>Arguments</h4>
|
||||
<dl>
|
||||
<dt>array</dt>
|
||||
<dd>
|
||||
An <i>array</i> to be converted to a <i>tuple</i>.
|
||||
</dd>
|
||||
</dl>
|
||||
<h4>Remarks</h4>
|
||||
<div>
|
||||
This macro expands to the data portion of an <i>array</i> which is a <i>tuple</i>.
|
||||
</div>
|
||||
<h4>Requirements</h4>
|
||||
<div>
|
||||
<b>Header:</b> <a href="../headers/array/data.hpp.html"><boost/preprocessor/array/data.hpp></a>
|
||||
</div>
|
||||
<h4><a class="local" onclick="toggle('sample');" onmouseover="change(this);" onmouseout="revert(this);">Sample Code</a></h4>
|
||||
<div id="sample"><pre>
|
||||
#include <boost/preprocessor/array/data.hpp>
|
||||
|
||||
#define ARRAY (3, (x, y, z))
|
||||
|
||||
BOOST_PP_ARRAY_DATA(ARRAY) // expands to (x, y, z)
|
||||
<pre></div>
|
||||
</body>
|
||||
</html>
|
41
docs.1/ref/array_elem.html
Normal file
41
docs.1/ref/array_elem.html
Normal file
@ -0,0 +1,41 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>BOOST_PP_ARRAY_ELEM</title>
|
||||
<link rel="stylesheet" type="text/css" href="../styles.css">
|
||||
<script language="javascript" type="text/javascript" src="../scripts.js"></script>
|
||||
</head>
|
||||
<body onload="init('sample');">
|
||||
<div style="margin-left: 0px;">
|
||||
The <b>BOOST_PP_ARRAY_ELEM</b> macro extracts an element from a <i>array</i>.
|
||||
</div>
|
||||
<h4>Usage</h4>
|
||||
<div class="code">
|
||||
<b>BOOST_PP_ARRAY_ELEM</b>(<i>i</i>, <i>array</i>)
|
||||
</div>
|
||||
<h4>Arguments</h4>
|
||||
<dl>
|
||||
<dt>i</dt>
|
||||
<dd>
|
||||
The zero-based index into the <i>array</i> of the element to be extracted.
|
||||
</dd>
|
||||
<dt>array</dt>
|
||||
<dd>
|
||||
The <i>array</i> from which an element is to be extracted.
|
||||
This <i>array</i> must contain at least <i>i</i> + <i>1</i> elements.
|
||||
</dd>
|
||||
</dl>
|
||||
<h4>Requirements</h4>
|
||||
<div>
|
||||
<b>Header:</b> <a href="../headers/array/elem.hpp.html"><boost/preprocessor/array/elem.hpp></a>
|
||||
</div>
|
||||
<h4><a class="local" onclick="toggle('sample');" onmouseover="change(this);" onmouseout="revert(this);">Sample Code</a></h4>
|
||||
<div id="sample"><pre>
|
||||
#include <boost/preprocessor/array/elem.hpp>
|
||||
|
||||
#define ARRAY (4, (a, b, c, d))
|
||||
|
||||
BOOST_PP_ARRAY_ELEM(0, ARRAY) // expands to a
|
||||
BOOST_PP_ARRAY_ELEM(3, ARRAY) // expands to d
|
||||
<pre></div>
|
||||
</body>
|
||||
</html>
|
35
docs.1/ref/array_size.html
Normal file
35
docs.1/ref/array_size.html
Normal file
@ -0,0 +1,35 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>BOOST_PP_ARRAY_SIZE</title>
|
||||
<link rel="stylesheet" type="text/css" href="../styles.css">
|
||||
<script language="javascript" type="text/javascript" src="../scripts.js"></script>
|
||||
</head>
|
||||
<body onload="init('sample');">
|
||||
<div style="margin-left: 0px;">
|
||||
The <b>BOOST_PP_ARRAY_SIZE</b> macro expands to the size of the <i>array</i> passed to it.
|
||||
</div>
|
||||
<h4>Usage</h4>
|
||||
<div class="code">
|
||||
<b>BOOST_PP_ARRAY_SIZE</b>(<i>array</i>)
|
||||
</div>
|
||||
<h4>Arguments</h4>
|
||||
<dl>
|
||||
<dt>array</dt>
|
||||
<dd>
|
||||
An <i>array</i> whose size is to be extracted.
|
||||
</dd>
|
||||
</dl>
|
||||
<h4>Requirements</h4>
|
||||
<div>
|
||||
<b>Header:</b> <a href="../headers/array/size.hpp.html"><boost/preprocessor/array/size.hpp></a>
|
||||
</div>
|
||||
<h4><a class="local" onclick="toggle('sample');" onmouseover="change(this);" onmouseout="revert(this);">Sample Code</a></h4>
|
||||
<div id="sample"><pre>
|
||||
#include <boost/preprocessor/array/size.hpp>
|
||||
|
||||
#define ARRAY (3, (x, y, z))
|
||||
|
||||
BOOST_PP_ARRAY_SIZE(ARRAY) // expands to 3
|
||||
<pre></div>
|
||||
</body>
|
||||
</html>
|
96
docs.1/ref/assert.html
Normal file
96
docs.1/ref/assert.html
Normal file
@ -0,0 +1,96 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>BOOST_PP_ASSERT</title>
|
||||
<link rel="stylesheet" type="text/css" href="../styles.css">
|
||||
<script language="javascript" type="text/javascript" src="../scripts.js"></script>
|
||||
</head>
|
||||
<body onload="init('sample');">
|
||||
<div style="margin-left: 0px;">
|
||||
The <b>BOOST_PP_ASSERT</b> macro conditionally causes a preprocessing error.
|
||||
</div>
|
||||
<h4>Usage</h4>
|
||||
<div class="code">
|
||||
<b>BOOST_PP_ASSERT</b>(<i>cond</i>)
|
||||
</div>
|
||||
<h4>Arguments</h4>
|
||||
<dl>
|
||||
<dt>cond</dt>
|
||||
<dd>
|
||||
A condition that determines whether an assertion occurs.
|
||||
Valid values range from <i>0</i> to <b>BOOST_PP_LIMIT_MAG</b>.
|
||||
</dd>
|
||||
</dl>
|
||||
<h4>Remarks</h4>
|
||||
<div>
|
||||
If <i>cond</i> expands to <i>0</i>, this macro causes a preprocessing error.
|
||||
Otherwise, it expands to nothing.
|
||||
</div>
|
||||
<h4>See Also</h4>
|
||||
<ul>
|
||||
<li><a href="assert_msg.html">BOOST_PP_ASSERT_MSG</a></li>
|
||||
<li><a href="limit_mag.html">BOOST_PP_LIMIT_MAG</a></li>
|
||||
</ul>
|
||||
<h4>Requirements</h4>
|
||||
<div>
|
||||
<b>Header:</b> <a href="../headers/debug/assert.hpp.html"><boost/preprocessor/debug/assert.hpp></a>
|
||||
</div>
|
||||
<h4><a class="local" onclick="toggle('sample');" onmouseover="change(this);" onmouseout="revert(this);">Sample Code</a></h4>
|
||||
<div id="sample"><pre>
|
||||
#include <boost/preprocessor/cat.hpp>
|
||||
#include <boost/preprocessor/debug/assert.hpp>
|
||||
#include <boost/preprocessor/detail/is_nullary.hpp>
|
||||
#include <boost/preprocessor/logical/bitnor.hpp>
|
||||
#include <boost/preprocessor/logical/compl.hpp>
|
||||
|
||||
#define IS_EDISON_DESIGN_GROUP() /* ..... */ \
|
||||
BOOST_PP_COMPL( \
|
||||
BOOST_PP_IS_NULLARY( \
|
||||
BOOST_PP_CAT(IS_EDG_CHECK, __EDG__) \
|
||||
) \
|
||||
) \
|
||||
/**/
|
||||
#define IS_EDG_CHECK__EDG__ ()
|
||||
|
||||
#define IS_METROWERKS() /* .................... */ \
|
||||
BOOST_PP_COMPL( \
|
||||
BOOST_PP_IS_NULLARY( \
|
||||
BOOST_PP_CAT(IS_MWERKS_CHECK, __MWERKS__) \
|
||||
) \
|
||||
) \
|
||||
/**/
|
||||
#define IS_MWERKS_CHECK__MWERKS__ ()
|
||||
|
||||
#define IS_MICROSOFT() /* ... */ \
|
||||
BOOST_PP_BITNOR( \
|
||||
IS_MICROSOFT_ROOT(), \
|
||||
IS_EDISON_DESIGN_GROUP() \
|
||||
) \
|
||||
/**/
|
||||
#define IS_MICROSOFT_ROOT() /* ......... */ \
|
||||
BOOST_PP_IS_NULLARY( \
|
||||
BOOST_PP_CAT(IS_MSVC_CHECK, _MSC_VER) \
|
||||
) \
|
||||
/**/
|
||||
#define IS_MSVC_CHECK_MS_VER ()
|
||||
|
||||
// this macro doesn't work on EDG...
|
||||
// (this is just an example)
|
||||
|
||||
#define MACRO(n) /* ....... */ \
|
||||
BOOST_PP_CAT( \
|
||||
MACRO_, \
|
||||
IS_EDISON_DESIGN_GROUP() \
|
||||
)(n) \
|
||||
/**/
|
||||
|
||||
#define MACRO_1(n) /* ................ */ \
|
||||
BOOST_PP_ASSERT(0) \
|
||||
"Edison Design Group is not supported" \
|
||||
/**/
|
||||
|
||||
#define MACRO_0(n) normal mode: n
|
||||
|
||||
MACRO(10)
|
||||
<pre></div>
|
||||
</body>
|
||||
</html>
|
56
docs.1/ref/assert_msg.html
Normal file
56
docs.1/ref/assert_msg.html
Normal file
@ -0,0 +1,56 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>BOOST_PP_ASSERT_MSG</title>
|
||||
<link rel="stylesheet" type="text/css" href="../styles.css">
|
||||
<script language="javascript" type="text/javascript" src="../scripts.js"></script>
|
||||
</head>
|
||||
<body onload="init('sample');">
|
||||
<div style="margin-left: 0px;">
|
||||
The <b>BOOST_PP_ASSERT_MSG</b> macro conditionally inserts debugging text.
|
||||
</div>
|
||||
<h4>Usage</h4>
|
||||
<div class="code">
|
||||
<b>BOOST_PP_ASSERT_MSG</b>(<i>cond</i>, <i>msg</i>)
|
||||
</div>
|
||||
<h4>Arguments</h4>
|
||||
<dl>
|
||||
<dt>cond</dt>
|
||||
<dd>
|
||||
A condition that determines whether an assertion occurs.
|
||||
Valid values range from <i>0</i> to <b>BOOST_PP_LIMIT_MAG</b>.
|
||||
</dd>
|
||||
<dt>msg</dt>
|
||||
<dd>
|
||||
A message to display if <i>cond</i> evaluates to <i>0</i>.
|
||||
</dd>
|
||||
</dl>
|
||||
<h4>Remarks</h4>
|
||||
<div>
|
||||
If <i>cond</i> expands to <i>0</i>, this macro expands to <i>msg</i>.
|
||||
Otherwise, it expands to nothing.
|
||||
</div>
|
||||
<h4>See Also</h4>
|
||||
<ul>
|
||||
<li><a href="assert_msg.html">BOOST_PP_ASSERT_MSG</a></li>
|
||||
<li><a href="limit_mag.html">BOOST_PP_LIMIT_MAG</a></li>
|
||||
</ul>
|
||||
<h4>Requirements</h4>
|
||||
<div>
|
||||
<b>Header:</b> <a href="../headers/debug/assert.hpp.html"><boost/preprocessor/debug/assert.hpp></a>
|
||||
</div>
|
||||
<h4><a class="local" onclick="toggle('sample');" onmouseover="change(this);" onmouseout="revert(this);">Sample Code</a></h4>
|
||||
<div id="sample"><pre>
|
||||
#include <boost/preprocessor/comparison/equal.hpp>
|
||||
#include <boost/preprocessor/debug/assert.hpp>
|
||||
|
||||
// lines are supposed to be counted
|
||||
// in translation phase 1
|
||||
|
||||
#line 9
|
||||
BOOST_PP_ASSERT_MSG( /* ....... */ \
|
||||
BOOST_PP_EQUAL(__LINE__, 9), \
|
||||
"weird line numbering detected" \
|
||||
)
|
||||
<pre></div>
|
||||
</body>
|
||||
</html>
|
51
docs.1/ref/assign_slot.html
Normal file
51
docs.1/ref/assign_slot.html
Normal file
@ -0,0 +1,51 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>BOOST_PP_ASSIGN_SLOT</title>
|
||||
<link rel="stylesheet" type="text/css" href="../styles.css">
|
||||
<script language="javascript" type="text/javascript" src="../scripts.js"></script>
|
||||
</head>
|
||||
<body onload="init('sample');">
|
||||
<div style="margin-left: 0px;">
|
||||
The <b>BOOST_PP_ASSIGN_SLOT</b> macro fully evaluates a numeric macro or expression.
|
||||
</div>
|
||||
<h4>Usage</h4>
|
||||
<div class="code">
|
||||
#include <b>BOOST_PP_ASSIGN_SLOT</b>(<i>i</i>)
|
||||
</div>
|
||||
<h4>Arguments</h4>
|
||||
<dl>
|
||||
<dt>i</dt>
|
||||
<dd>
|
||||
The <i>slot</i> index that is to be assigned.
|
||||
This value must be in the range of <i>1</i> to <b>BOOST_PP_LIMIT_SLOT_COUNT</b>.
|
||||
</dd>
|
||||
</dl>
|
||||
<h4>Remarks</h4>
|
||||
<div>
|
||||
Prior to use, the <i>named external argument</i> <b>BOOST_PP_VALUE</b> must be defined.
|
||||
Also, it must expand to a numeric value that is in the range of <i>0</i> to <i>2</i>^<i>32</i> - <i>1</i>.
|
||||
</div>
|
||||
<h4>See Also</h4>
|
||||
<ul>
|
||||
<li><a href="limit_slot_count.html">BOOST_PP_LIMIT_SLOT_COUNT</a></li>
|
||||
<li><a href="value.html">BOOST_PP_VALUE</a></li>
|
||||
</ul>
|
||||
<h4>Requirements</h4>
|
||||
<div>
|
||||
<b>Header:</b> <a href="../headers/slot/slot.hpp.html"><boost/preprocessor/slot/slot.hpp></a>
|
||||
</div>
|
||||
<h4><a class="local" onclick="toggle('sample');" onmouseover="change(this);" onmouseout="revert(this);">Sample Code</a></h4>
|
||||
<div id="sample"><pre>
|
||||
#include <boost/preprocessor/slot/slot.hpp>
|
||||
|
||||
#define X() 4
|
||||
|
||||
#define BOOST_PP_VALUE 1 + 2 + 3 + X()
|
||||
#include BOOST_PP_ASSIGN_SLOT(1)
|
||||
|
||||
#undef X
|
||||
|
||||
BOOST_PP_SLOT(1) // expands to 10
|
||||
<pre></div>
|
||||
</body>
|
||||
</html>
|
55
docs.1/ref/bitand.html
Normal file
55
docs.1/ref/bitand.html
Normal file
@ -0,0 +1,55 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>BOOST_PP_BITAND</title>
|
||||
<link rel="stylesheet" type="text/css" href="../styles.css">
|
||||
<script language="javascript" type="text/javascript" src="../scripts.js"></script>
|
||||
</head>
|
||||
<body onload="init('sample');">
|
||||
<div style="margin-left: 0px;">
|
||||
The <b>BOOST_PP_BITAND</b> macro expands to the bitwise <i>AND</i> of its operands.
|
||||
</div>
|
||||
<h4>Usage</h4>
|
||||
<div class="code">
|
||||
<b>BOOST_PP_BITAND</b>(<i>x</i>, <i>y</i>)
|
||||
</div>
|
||||
<h4>Arguments</h4>
|
||||
<dl>
|
||||
<dt>x</dt>
|
||||
<dd>
|
||||
The left operand of the operation.
|
||||
This value must expand to <i>0</i> or <i>1</i>.
|
||||
</dd>
|
||||
<dt>y</dt>
|
||||
<dd>
|
||||
The right operand of the operation.
|
||||
This value must expand to <i>0</i> or <i>1</i>.
|
||||
</dd>
|
||||
</dl>
|
||||
<h4>Remarks</h4>
|
||||
<div>
|
||||
If both <i>x</i> and <i>y</i> are <i>1</i>, this macro expands to <i>1</i>.
|
||||
Otherwise, it expands to <i>0</i>.
|
||||
</div>
|
||||
<div>
|
||||
This macro <i>does not</i> perform a boolean conversion on either operand before performing the bitwise <i>AND</i> operation.
|
||||
If that conversion is necessary, use <b>BOOST_PP_AND</b> instead.
|
||||
</div>
|
||||
<h4>See Also</h4>
|
||||
<ul>
|
||||
<li><a href="and.html">BOOST_PP_AND</a></li>
|
||||
</ul>
|
||||
<h4>Requirements</h4>
|
||||
<div>
|
||||
<b>Header:</b> <a href="../headers/logical/bitand.hpp.html"><boost/preprocessor/logical/bitand.hpp></a>
|
||||
</div>
|
||||
<h4><a class="local" onclick="toggle('sample');" onmouseover="change(this);" onmouseout="revert(this);">Sample Code</a></h4>
|
||||
<div id="sample"><pre>
|
||||
#include <boost/preprocessor/logical/bitand.hpp>
|
||||
|
||||
BOOST_PP_BITAND(0, 0) // expands to 0
|
||||
BOOST_PP_BITAND(0, 1) // expands to 0
|
||||
BOOST_PP_BITAND(1, 0) // expands to 0
|
||||
BOOST_PP_BITAND(1, 1) // expands to 1
|
||||
<pre></div>
|
||||
</body>
|
||||
</html>
|
55
docs.1/ref/bitnor.html
Normal file
55
docs.1/ref/bitnor.html
Normal file
@ -0,0 +1,55 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>BOOST_PP_BITNOR</title>
|
||||
<link rel="stylesheet" type="text/css" href="../styles.css">
|
||||
<script language="javascript" type="text/javascript" src="../scripts.js"></script>
|
||||
</head>
|
||||
<body onload="init('sample');">
|
||||
<div style="margin-left: 0px;">
|
||||
The <b>BOOST_PP_BITNOR</b> macro expands to the bitwise <i>NOR</i> of its operands.
|
||||
</div>
|
||||
<h4>Usage</h4>
|
||||
<div class="code">
|
||||
<b>BOOST_PP_BITNOR</b>(<i>x</i>, <i>y</i>)
|
||||
</div>
|
||||
<h4>Arguments</h4>
|
||||
<dl>
|
||||
<dt>x</dt>
|
||||
<dd>
|
||||
The left operand of the operation.
|
||||
This value must expand to <i>0</i> or <i>1</i>.
|
||||
</dd>
|
||||
<dt>y</dt>
|
||||
<dd>
|
||||
The right operand of the operation.
|
||||
This value must expand to <i>0</i> or <i>1</i>.
|
||||
</dd>
|
||||
</dl>
|
||||
<h4>Remarks</h4>
|
||||
<div>
|
||||
If neither <i>x</i> nor <i>y</i> is <i>1</i>, this macro expands to <i>1</i>.
|
||||
Otherwise, it expands to <i>0</i>.
|
||||
</div>
|
||||
<div>
|
||||
This macro <i>does not</i> perform a boolean conversion on either operand before performing the bitwise <i>NOR</i> operation.
|
||||
If that conversion is necessary, use <b>BOOST_PP_NOR</b> instead.
|
||||
</div>
|
||||
<h4>See Also</h4>
|
||||
<ul>
|
||||
<li><a href="nor.html">BOOST_PP_NOR</a></li>
|
||||
</ul>
|
||||
<h4>Requirements</h4>
|
||||
<div>
|
||||
<b>Header:</b> <a href="../headers/logical/bitnor.hpp.html"><boost/preprocessor/logical/bitnor.hpp></a>
|
||||
</div>
|
||||
<h4><a class="local" onclick="toggle('sample');" onmouseover="change(this);" onmouseout="revert(this);">Sample Code</a></h4>
|
||||
<div id="sample"><pre>
|
||||
#include <boost/preprocessor/logical/bitnor.hpp>
|
||||
|
||||
BOOST_PP_BITNOR(0, 0) // expands to 1
|
||||
BOOST_PP_BITNOR(0, 1) // expands to 0
|
||||
BOOST_PP_BITNOR(1, 0) // expands to 0
|
||||
BOOST_PP_BITNOR(1, 1) // expands to 0
|
||||
<pre></div>
|
||||
</body>
|
||||
</html>
|
55
docs.1/ref/bitor.html
Normal file
55
docs.1/ref/bitor.html
Normal file
@ -0,0 +1,55 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>BOOST_PP_BITOR</title>
|
||||
<link rel="stylesheet" type="text/css" href="../styles.css">
|
||||
<script language="javascript" type="text/javascript" src="../scripts.js"></script>
|
||||
</head>
|
||||
<body onload="init('sample');">
|
||||
<div style="margin-left: 0px;">
|
||||
The <b>BOOST_PP_BITOR</b> macro expands to the bitwise <i>OR</i> of its operands.
|
||||
</div>
|
||||
<h4>Usage</h4>
|
||||
<div class="code">
|
||||
<b>BOOST_PP_BITOR</b>(<i>x</i>, <i>y</i>)
|
||||
</div>
|
||||
<h4>Arguments</h4>
|
||||
<dl>
|
||||
<dt>x</dt>
|
||||
<dd>
|
||||
The left operand of the operation.
|
||||
This value must expand to <i>0</i> or <i>1</i>.
|
||||
</dd>
|
||||
<dt>y</dt>
|
||||
<dd>
|
||||
The right operand of the operation.
|
||||
This value must expand to <i>0</i> or <i>1</i>.
|
||||
</dd>
|
||||
</dl>
|
||||
<h4>Remarks</h4>
|
||||
<div>
|
||||
If either <i>x</i> or <i>y</i> is <i>1</i>, this macro expands to <i>1</i>.
|
||||
Otherwise, it expands to <i>0</i>.
|
||||
</div>
|
||||
<div>
|
||||
This macro <i>does not</i> perform a boolean conversion on either operand before performing the bitwise <i>OR</i> operation.
|
||||
If that conversion is necessary, use <b>BOOST_PP_OR</b> instead.
|
||||
</div>
|
||||
<h4>See Also</h4>
|
||||
<ul>
|
||||
<li><a href="or.html">BOOST_PP_OR</a></li>
|
||||
</ul>
|
||||
<h4>Requirements</h4>
|
||||
<div>
|
||||
<b>Header:</b> <a href="../headers/logical/bitor.hpp.html"><boost/preprocessor/logical/bitor.hpp></a>
|
||||
</div>
|
||||
<h4><a class="local" onclick="toggle('sample');" onmouseover="change(this);" onmouseout="revert(this);">Sample Code</a></h4>
|
||||
<div id="sample"><pre>
|
||||
#include <boost/preprocessor/logical/bitor.hpp>
|
||||
|
||||
BOOST_PP_BITOR(0, 0) // expands to 0
|
||||
BOOST_PP_BITOR(0, 1) // expands to 1
|
||||
BOOST_PP_BITOR(1, 0) // expands to 1
|
||||
BOOST_PP_BITOR(1, 1) // expands to 1
|
||||
<pre></div>
|
||||
</body>
|
||||
</html>
|
55
docs.1/ref/bitxor.html
Normal file
55
docs.1/ref/bitxor.html
Normal file
@ -0,0 +1,55 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>BOOST_PP_BITXOR</title>
|
||||
<link rel="stylesheet" type="text/css" href="../styles.css">
|
||||
<script language="javascript" type="text/javascript" src="../scripts.js"></script>
|
||||
</head>
|
||||
<body onload="init('sample');">
|
||||
<div style="margin-left: 0px;">
|
||||
The <b>BOOST_PP_BITXOR</b> macro expands to the bitwise <i>XOR</i> of its operands.
|
||||
</div>
|
||||
<h4>Usage</h4>
|
||||
<div class="code">
|
||||
<b>BOOST_PP_BITXOR</b>(<i>x</i>, <i>y</i>)
|
||||
</div>
|
||||
<h4>Arguments</h4>
|
||||
<dl>
|
||||
<dt>x</dt>
|
||||
<dd>
|
||||
The left operand of the operation.
|
||||
This value must expand to <i>0</i> or <i>1</i>.
|
||||
</dd>
|
||||
<dt>y</dt>
|
||||
<dd>
|
||||
The right operand of the operation.
|
||||
This value must expand to <i>0</i> or <i>1</i>.
|
||||
</dd>
|
||||
</dl>
|
||||
<h4>Remarks</h4>
|
||||
<div>
|
||||
If either <i>x</i> or <i>y</i> is <i>1</i> exclusively, this macro expands to <i>1</i>.
|
||||
Otherwise, it expands to <i>0</i>.
|
||||
</div>
|
||||
<div>
|
||||
This macro <i>does not</i> perform a boolean conversion on either operand before performing the bitwise <i>OR</i> operation.
|
||||
If that conversion is necessary, use <b>BOOST_PP_XOR</b> instead.
|
||||
</div>
|
||||
<h4>See Also</h4>
|
||||
<ul>
|
||||
<li><a href="xor.html">BOOST_PP_XOR</a></li>
|
||||
</ul>
|
||||
<h4>Requirements</h4>
|
||||
<div>
|
||||
<b>Header:</b> <a href="../headers/logical/bitxor.hpp.html"><boost/preprocessor/logical/bitxor.hpp></a>
|
||||
</div>
|
||||
<h4><a class="local" onclick="toggle('sample');" onmouseover="change(this);" onmouseout="revert(this);">Sample Code</a></h4>
|
||||
<div id="sample"><pre>
|
||||
#include <boost/preprocessor/logical/bitxor.hpp>
|
||||
|
||||
BOOST_PP_BITXOR(0, 0) // expands to 0
|
||||
BOOST_PP_BITXOR(0, 1) // expands to 1
|
||||
BOOST_PP_BITXOR(1, 0) // expands to 1
|
||||
BOOST_PP_BITXOR(1, 1) // expands to 0
|
||||
<pre></div>
|
||||
</body>
|
||||
</html>
|
54
docs.1/ref/bool.html
Normal file
54
docs.1/ref/bool.html
Normal file
@ -0,0 +1,54 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>BOOST_PP_BOOL</title>
|
||||
<link rel="stylesheet" type="text/css" href="../styles.css">
|
||||
<script language="javascript" type="text/javascript" src="../scripts.js"></script>
|
||||
</head>
|
||||
<body onload="init('sample');">
|
||||
<div style="margin-left: 0px;">
|
||||
The <b>BOOST_PP_BOOL</b> macro performs a boolean conversion on its operand.
|
||||
</div>
|
||||
<h4>Usage</h4>
|
||||
<div class="code">
|
||||
<b>BOOST_PP_BOOL</b>(<i>x</i>)
|
||||
</div>
|
||||
<h4>Arguments</h4>
|
||||
<dl>
|
||||
<dt>x</dt>
|
||||
<dd>
|
||||
The value to be converted.
|
||||
Valid values range from <i>0</i> to <b>BOOST_PP_LIMIT_MAG</b>*.
|
||||
</dd>
|
||||
</dl>
|
||||
<h4>Remarks</h4>
|
||||
<div>
|
||||
If <i>x</i> is <i>0</i>, this macro expands to <i>0</i>.
|
||||
Otherwise it expands to <i>1</i>.
|
||||
</div>
|
||||
<div>
|
||||
*If <b>BOOST_PP_CONFIG_FLAGS</b> does not include <b>BOOST_PP_CONFIG_EDG</b>, this macro can convert an infinite range--e.g. <b>BOOST_PP_BOOL</b>(<i>123456789</i>).
|
||||
However, it is not safe to rely on this behavior unless it is known that <i>EDG</i>-based compilers will never be used.
|
||||
</div>
|
||||
<h4>See Also</h4>
|
||||
<ul>
|
||||
<li><a href="limit_mag.html">BOOST_PP_LIMIT_MAG</a></li>
|
||||
</ul>
|
||||
<h4>Requirements</h4>
|
||||
<div>
|
||||
<b>Header:</b> <a href="../headers/logical/bool.hpp.html"><boost/preprocessor/logical/bool.hpp></a>
|
||||
</div>
|
||||
<h4><a class="local" onclick="toggle('sample');" onmouseover="change(this);" onmouseout="revert(this);">Sample Code</a></h4>
|
||||
<div id="sample"><pre>
|
||||
#include <boost/preprocessor/logical/bool.hpp>
|
||||
|
||||
BOOST_PP_BOOL(6) // expands to 1
|
||||
BOOST_PP_BOOL(0) // expands to 0
|
||||
|
||||
#if ~BOOST_PP_CONFIG_FLAGS & BOOST_PP_CONFIG_EDG
|
||||
|
||||
BOOST_PP_BOOL(123456789) // expands to 1
|
||||
|
||||
#endif
|
||||
<pre></div>
|
||||
</body>
|
||||
</html>
|
47
docs.1/ref/cat.html
Normal file
47
docs.1/ref/cat.html
Normal file
@ -0,0 +1,47 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>BOOST_PP_CAT</title>
|
||||
<link rel="stylesheet" type="text/css" href="../styles.css">
|
||||
<script language="javascript" type="text/javascript" src="../scripts.js"></script>
|
||||
</head>
|
||||
<body onload="init('sample');">
|
||||
<div style="margin-left: 0px;">
|
||||
The <b>BOOST_PP_CAT</b> macro concatenates its arguments after they have been expanded.
|
||||
</div>
|
||||
<h4>Usage</h4>
|
||||
<div class="code">
|
||||
<b>BOOST_PP_CAT</b>(<i>a</i>, <i>b</i>)
|
||||
</div>
|
||||
<h4>Arguments</h4>
|
||||
<dl>
|
||||
<dt>a</dt>
|
||||
<dd>
|
||||
The left operand of the concatenation.
|
||||
</dd>
|
||||
<dt>b</dt>
|
||||
<dd>
|
||||
The right operand of the concatenation.
|
||||
</dd>
|
||||
</dl>
|
||||
<h4>Remarks</h4>
|
||||
<div>
|
||||
The preprocessor token-pasting operator (<b>##</b>) prevents arguments from expanding.
|
||||
This macro allows its arguments to expand before concatenation.
|
||||
</div>
|
||||
<div>
|
||||
Concatenation must not result in an invocation of a macro that uses <b>BOOST_PP_CAT</b>.
|
||||
If that happens, <b>BOOST_PP_CAT</b> will not expand the second time.
|
||||
</div>
|
||||
<!-- <h4>See Also</h4> -->
|
||||
<h4>Requirements</h4>
|
||||
<div>
|
||||
<b>Header:</b> <a href="../headers/cat.hpp.html"><boost/preprocessor/cat.hpp></a>
|
||||
</div>
|
||||
<h4><a class="local" onclick="toggle('sample');" onmouseover="change(this);" onmouseout="revert(this);">Sample Code</a></h4>
|
||||
<div id="sample"><pre>
|
||||
#include <boost/preprocessor/cat.hpp>
|
||||
|
||||
BOOST_PP_CAT(x, BOOST_PP_CAT(y, z)) // expands to xyz
|
||||
<pre></div>
|
||||
</body>
|
||||
</html>
|
33
docs.1/ref/comma.html
Normal file
33
docs.1/ref/comma.html
Normal file
@ -0,0 +1,33 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>BOOST_PP_COMMA</title>
|
||||
<link rel="stylesheet" type="text/css" href="../styles.css">
|
||||
<script language="javascript" type="text/javascript" src="../scripts.js"></script>
|
||||
</head>
|
||||
<body onload="init('sample');">
|
||||
<div style="margin-left: 0px;">
|
||||
The <b>BOOST_PP_COMMA</b> macro expands to a comma.
|
||||
</div>
|
||||
<h4>Usage</h4>
|
||||
<div class="code">
|
||||
<b>BOOST_PP_COMMA</b>()
|
||||
</div>
|
||||
<h4>Remarks</h4>
|
||||
<div>
|
||||
The preprocessor interprets commas as argument separators in macro invocations.
|
||||
Because of this, commas require special handling.
|
||||
</div>
|
||||
<h4>Requirements</h4>
|
||||
<div>
|
||||
<b>Header:</b> <a href="../headers/punctuation/comma.hpp.html"><boost/preprocessor/punctuation/comma.hpp></a>
|
||||
</div>
|
||||
<h4><a class="local" onclick="toggle('sample');" onmouseover="change(this);" onmouseout="revert(this);">Sample Code</a></h4>
|
||||
<div id="sample"><pre>
|
||||
#include <boost/preprocessor/control/if.hpp>
|
||||
#include <boost/preprocessor/facilities/empty.hpp>
|
||||
#include <boost/preprocessor/punctuation/comma.hpp>
|
||||
|
||||
BOOST_PP_IF(1, BOOST_PP_COMMA, BOOST_PP_EMPTY)() // expands to ,
|
||||
<pre></div>
|
||||
</body>
|
||||
</html>
|
50
docs.1/ref/comma_if.html
Normal file
50
docs.1/ref/comma_if.html
Normal file
@ -0,0 +1,50 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>BOOST_PP_COMMA_IF</title>
|
||||
<link rel="stylesheet" type="text/css" href="../styles.css">
|
||||
<script language="javascript" type="text/javascript" src="../scripts.js"></script>
|
||||
</head>
|
||||
<body onload="init('sample');">
|
||||
<div style="margin-left: 0px;">
|
||||
The <b>BOOST_PP_COMMA_IF</b> macro conditionally expands to a comma.
|
||||
</div>
|
||||
<h4>Usage</h4>
|
||||
<div class="code">
|
||||
<b>BOOST_PP_COMMA_IF</b>(<i>cond</i>)
|
||||
</div>
|
||||
<h4>Arguments</h4>
|
||||
<dl>
|
||||
<dt>cond</dt>
|
||||
<dd>
|
||||
The condition that determines if a the macro expands to a comma or nothing.
|
||||
Valid values range from <i>0</i> to <b>BOOST_PP_LIMIT_MAG</b>.
|
||||
</dd>
|
||||
</dl>
|
||||
<h4>Remarks</h4>
|
||||
<div>
|
||||
If <i>cond</i> expands to <i>0</i>, this macro expands to nothing.
|
||||
Otherwise, it expands to a comma.
|
||||
</div>
|
||||
<div>
|
||||
The preprocessor interprets commas as argument separators in macro invocations.
|
||||
Because of this, commas require special handling.
|
||||
</div>
|
||||
<h4>See Also</h4>
|
||||
<ul>
|
||||
<li><a href="limit_mag.html">BOOST_PP_LIMIT_MAG</a></li>
|
||||
</ul>
|
||||
<h4>Requirements</h4>
|
||||
<div>
|
||||
<b>Header:</b> <a href="../headers/punctuation/comma_if.hpp.html"><boost/preprocessor/punctuation/comma_if.hpp></a>
|
||||
</div>
|
||||
<h4><a class="local" onclick="toggle('sample');" onmouseover="change(this);" onmouseout="revert(this);">Sample Code</a></h4>
|
||||
<div id="sample"><pre>
|
||||
#include <boost/preprocessor/punctuation/comma_if.hpp>
|
||||
#include <boost/preprocessor/repetition/repeat.hpp>
|
||||
|
||||
#define MACRO(z, n, text) BOOST_PP_COMMA_IF(n) text
|
||||
|
||||
BOOST_PP_REPEAT(3, MACRO, class) // expands to class, class, class
|
||||
<pre></div>
|
||||
</body>
|
||||
</html>
|
48
docs.1/ref/compl.html
Normal file
48
docs.1/ref/compl.html
Normal file
@ -0,0 +1,48 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>BOOST_PP_COMPL</title>
|
||||
<link rel="stylesheet" type="text/css" href="../styles.css">
|
||||
<script language="javascript" type="text/javascript" src="../scripts.js"></script>
|
||||
</head>
|
||||
<body onload="init('sample');">
|
||||
<div style="margin-left: 0px;">
|
||||
The <b>BOOST_PP_COMPL</b> macro performs a bitwise inversion (bitwise <i>NOT</i> or one's complement) on its operand.
|
||||
</div>
|
||||
<h4>Usage</h4>
|
||||
<div class="code">
|
||||
<b>BOOST_PP_COMPL</b>(<i>x</i>)
|
||||
</div>
|
||||
<h4>Arguments</h4>
|
||||
<dl>
|
||||
<dt>x</dt>
|
||||
<dd>
|
||||
The value to be converted.
|
||||
This value must expand to <i>0</i> or <i>1</i>.
|
||||
</dd>
|
||||
</dl>
|
||||
<h4>Remarks</h4>
|
||||
<div>
|
||||
If <i>x</i> is <i>0</i>, this macro expands to <i>1</i>.
|
||||
If <i>x</i> is <i>1</i>, this it expands to <i>0</i>.
|
||||
</div>
|
||||
<div>
|
||||
This macro <i>does not</i> perform a boolean conversion on its operand before performing the inversion <i>OR</i> operation.
|
||||
If that conversion is necessary, use <b>BOOST_PP_NOT</b> instead.
|
||||
</div>
|
||||
<h4>See Also</h4>
|
||||
<ul>
|
||||
<li><a href="not.html">BOOST_PP_NOT</a></li>
|
||||
</ul>
|
||||
<h4>Requirements</h4>
|
||||
<div>
|
||||
<b>Header:</b> <a href="../headers/logical/compl.hpp.html"><boost/preprocessor/logical/compl.hpp></a>
|
||||
</div>
|
||||
<h4><a class="local" onclick="toggle('sample');" onmouseover="change(this);" onmouseout="revert(this);">Sample Code</a></h4>
|
||||
<div id="sample"><pre>
|
||||
#include <boost/preprocessor/logical/compl.hpp>
|
||||
|
||||
BOOST_PP_COMPL(1) // expands to 0
|
||||
BOOST_PP_COMPL(0) // expands to 1
|
||||
<pre></div>
|
||||
</body>
|
||||
</html>
|
29
docs.1/ref/config_errors.html
Normal file
29
docs.1/ref/config_errors.html
Normal file
@ -0,0 +1,29 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>BOOST_PP_CONFIG_ERRORS</title>
|
||||
<link rel="stylesheet" type="text/css" href="../styles.css">
|
||||
<script language="javascript" type="text/javascript" src="../scripts.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<div style="margin-left: 0px;">
|
||||
The <b>BOOST_PP_CONFIG_ERRORS</b> is a user-defined macro that determines whether library overflows and certain other errors are expanded to error messages.
|
||||
</div>
|
||||
<h4>Usage</h4>
|
||||
<div class="code">
|
||||
#define <b>BOOST_PP_CONFIG_ERRORS</b> <i>n</i>
|
||||
</div>
|
||||
<h4>Arguments</h4>
|
||||
<dl>
|
||||
<dt>n</dt>
|
||||
<dd>
|
||||
The value that determines if error codes are expanded.
|
||||
This value must be <i>0</i> or <i>1</i>.
|
||||
</dd>
|
||||
</dl>
|
||||
<h4>Remarks</h4>
|
||||
<div>
|
||||
By default, if <i>NDEBUG</i> is not defined, this macro is set to <i>1</i>.
|
||||
Otherwise, it is set to <i>0</i>.
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
33
docs.1/ref/config_extended_line_info.html
Normal file
33
docs.1/ref/config_extended_line_info.html
Normal file
@ -0,0 +1,33 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>BOOST_PP_CONFIG_EXTENDED_LINE_INFO</title>
|
||||
<link rel="stylesheet" type="text/css" href="../styles.css">
|
||||
<script language="javascript" type="text/javascript" src="../scripts.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<div style="margin-left: 0px;">
|
||||
The <b>BOOST_PP_CONFIG_EXTENDED_LINE_INFO</b> is a user-defined macro that determines whether <b>BOOST_PP_LINE</b> outputs extended <i>file-iteration</i> state information.
|
||||
</div>
|
||||
<h4>Usage</h4>
|
||||
<div class="code">
|
||||
#define <b>BOOST_PP_CONFIG_EXTENDED_LINE_INFO</b> <i>n</i>
|
||||
</div>
|
||||
<h4>Arguments</h4>
|
||||
<dl>
|
||||
<dt>n</dt>
|
||||
<dd>
|
||||
The value that determines if <b>BOOST_PP_LINE</b> outputs extended <i>file-iteration</i> information.
|
||||
This value must be <i>0</i> or <i>1</i>.
|
||||
</dd>
|
||||
</dl>
|
||||
<h4>Remarks</h4>
|
||||
<div>
|
||||
If <i>n</i> is <i>1</i>, <b>BOOST_PP_LINE</b> will output extended data.
|
||||
By default, this macro is set to <i>0</i>.
|
||||
</div>
|
||||
<h4>See Also</h4>
|
||||
<ul>
|
||||
<li><a href="line.html">BOOST_PP_LINE</a></li>
|
||||
</ul>
|
||||
</body>
|
||||
</html>
|
29
docs.1/ref/config_unrolled.html
Normal file
29
docs.1/ref/config_unrolled.html
Normal file
@ -0,0 +1,29 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>BOOST_PP_CONFIG_UNROLLED</title>
|
||||
<link rel="stylesheet" type="text/css" href="../styles.css">
|
||||
<script language="javascript" type="text/javascript" src="../scripts.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<div style="margin-left: 0px;">
|
||||
The <b>BOOST_PP_CONFIG_UNROLLED</b> is a user-defined macro that determines whether <b>BOOST_PP_REPEAT</b> is unrolled.
|
||||
</div>
|
||||
<h4>Usage</h4>
|
||||
<div class="code">
|
||||
#define <b>BOOST_PP_CONFIG_UNROLLED</b> <i>n</i>
|
||||
</div>
|
||||
<h4>Arguments</h4>
|
||||
<dl>
|
||||
<dt>n</dt>
|
||||
<dd>
|
||||
The value that determines if <b>BOOST_PP_REPEAT</b> is unrolled.
|
||||
This value must be <i>0</i> or <i>1</i>.
|
||||
</dd>
|
||||
</dl>
|
||||
<h4>Remarks</h4>
|
||||
<div>
|
||||
If <i>n</i> is <i>1</i>, <b>BOOST_PP_REPEAT</b> will be unrolled.
|
||||
By default, this macro is set to <i>0</i>.
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
44
docs.1/ref/dec.html
Normal file
44
docs.1/ref/dec.html
Normal file
@ -0,0 +1,44 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>BOOST_PP_DEC</title>
|
||||
<link rel="stylesheet" type="text/css" href="../styles.css">
|
||||
<script language="javascript" type="text/javascript" src="../scripts.js"></script>
|
||||
</head>
|
||||
<body onload="init('sample');">
|
||||
<div style="margin-left: 0px;">
|
||||
The <b>BOOST_PP_DEC</b> macro expands to one less than its argument.
|
||||
</div>
|
||||
<h4>Usage</h4>
|
||||
<div class="code">
|
||||
<b>BOOST_PP_DEC</b>(<i>x</i>)
|
||||
</div>
|
||||
<h4>Arguments</h4>
|
||||
<dl>
|
||||
<dt>x</dt>
|
||||
<dd>
|
||||
The value to be decremented.
|
||||
Valid values range from <i>0</i> to <b>BOOST_PP_LIMIT_MAG</b>.
|
||||
</dd>
|
||||
</dl>
|
||||
<h4>Remarks</h4>
|
||||
<div>
|
||||
If <i>x</i> is <i>0</i>, the result is saturated to <i>0</i>.
|
||||
</div>
|
||||
<h4>See Also</h4>
|
||||
<ul>
|
||||
<li><a href="inc.html">BOOST_PP_INC</a></li>
|
||||
<li><a href="limit_mag.html">BOOST_PP_LIMIT_MAG</a></li>
|
||||
</ul>
|
||||
<h4>Requirements</h4>
|
||||
<div>
|
||||
<b>Header:</b> <a href="../headers/arithmetic/dec.hpp.html"><boost/preprocessor/arithmetic/dec.hpp></a>
|
||||
</div>
|
||||
<h4><a class="local" onclick="toggle('sample');" onmouseover="change(this);" onmouseout="revert(this);">Sample Code</a></h4>
|
||||
<div id="sample"><pre>
|
||||
#include <boost/preprocessor/arithmetic/dec.hpp>
|
||||
|
||||
BOOST_PP_DEC(BOOST_PP_DEC(6)) // expands to 4
|
||||
BOOST_PP_DEC(0) // expands to 0
|
||||
<pre></div>
|
||||
</body>
|
||||
</html>
|
53
docs.1/ref/div.html
Normal file
53
docs.1/ref/div.html
Normal file
@ -0,0 +1,53 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>BOOST_PP_DIV</title>
|
||||
<link rel="stylesheet" type="text/css" href="../styles.css">
|
||||
<script language="javascript" type="text/javascript" src="../scripts.js"></script>
|
||||
</head>
|
||||
<body onload="init('sample');">
|
||||
<div style="margin-left: 0px;">
|
||||
The <b>BOOST_PP_DIV</b> macro expands to the quotient of its arguments.
|
||||
</div>
|
||||
<h4>Usage</h4>
|
||||
<div class="code">
|
||||
<b>BOOST_PP_DIV</b>(<i>x</i>, <i>y</i>)
|
||||
</div>
|
||||
<h4>Arguments</h4>
|
||||
<dl>
|
||||
<dt>x</dt>
|
||||
<dd>
|
||||
The dividend (numerator) of the operation.
|
||||
Valid values range from <i>0</i> to <b>BOOST_PP_LIMIT_MAG</b>.
|
||||
</dd>
|
||||
<dt>y</dt>
|
||||
<dd>
|
||||
The divisor (denominator) of the operation.
|
||||
Valid values range from <i>1</i> to <b>BOOST_PP_LIMIT_MAG</b>.
|
||||
</dd>
|
||||
</dl>
|
||||
<h4>Remarks</h4>
|
||||
<div>
|
||||
Previously, this macro could not be used inside <b>BOOST_PP_WHILE</b>.
|
||||
There is no longer any such restriction.
|
||||
It is more efficient, however, to use <b>BOOST_PP_DIV_D</b> in such a situation.
|
||||
</div>
|
||||
<div>
|
||||
If <i>y</i> is <i>0</i>, the result is undefined.
|
||||
</div>
|
||||
<h4>See Also</h4>
|
||||
<ul>
|
||||
<li><a href="div_d.html">BOOST_PP_DIV_D</a></li>
|
||||
<li><a href="limit_mag.html">BOOST_PP_LIMIT_MAG</a></li>
|
||||
</ul>
|
||||
<h4>Requirements</h4>
|
||||
<div>
|
||||
<b>Header:</b> <a href="../headers/arithmetic/div.hpp.html"><boost/preprocessor/arithmetic/div.hpp></a>
|
||||
</div>
|
||||
<h4><a class="local" onclick="toggle('sample');" onmouseover="change(this);" onmouseout="revert(this);">Sample Code</a></h4>
|
||||
<div id="sample"><pre>
|
||||
#include <boost/preprocessor/arithmetic/div.hpp>
|
||||
|
||||
BOOST_PP_DIV(11, 5) // expands to 2
|
||||
<pre></div>
|
||||
</body>
|
||||
</html>
|
75
docs.1/ref/div_d.html
Normal file
75
docs.1/ref/div_d.html
Normal file
@ -0,0 +1,75 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>BOOST_PP_DIV_D</title>
|
||||
<link rel="stylesheet" type="text/css" href="../styles.css">
|
||||
<script language="javascript" type="text/javascript" src="../scripts.js"></script>
|
||||
</head>
|
||||
<body onload="init('sample');">
|
||||
<div style="margin-left: 0px;">
|
||||
The <b>BOOST_PP_DIV_D</b> macro expands to the quotient of its second and third arguments.
|
||||
It reenters <b>BOOST_PP_WHILE</b> with maximum efficiency.
|
||||
</div>
|
||||
<h4>Usage</h4>
|
||||
<div class="code">
|
||||
<b>BOOST_PP_DIV_D</b>(<i>d</i>, <i>x</i>, <i>y</i>)
|
||||
</div>
|
||||
<h4>Arguments</h4>
|
||||
<dl>
|
||||
<dt>d</dt>
|
||||
<dd>
|
||||
The next available <b>BOOST_PP_WHILE</b> iteration.
|
||||
</dd>
|
||||
<dt>x</dt>
|
||||
<dd>
|
||||
The dividend (numerator) of the operation.
|
||||
Valid values range from <i>0</i> to <b>BOOST_PP_LIMIT_MAG</b>.
|
||||
</dd>
|
||||
<dt>y</dt>
|
||||
<dd>
|
||||
The divisor (denominator) of the operation.
|
||||
Valid values range from <i>1</i> to <b>BOOST_PP_LIMIT_MAG</b>.
|
||||
</dd>
|
||||
</dl>
|
||||
<h4>Remarks</h4>
|
||||
<div>
|
||||
If <i>y</i> is <i>0</i>, the result is undefined.
|
||||
</div>
|
||||
<h4>See Also</h4>
|
||||
<ul>
|
||||
<li><a href="div.html">BOOST_PP_DIV</a></li>
|
||||
<li><a href="limit_mag.html">BOOST_PP_LIMIT_MAG</a></li>
|
||||
</ul>
|
||||
<h4>Requirements</h4>
|
||||
<div>
|
||||
<b>Header:</b> <a href="../headers/arithmetic/div.hpp.html"><boost/preprocessor/arithmetic/div.hpp></a>
|
||||
</div>
|
||||
<h4><a class="local" onclick="toggle('sample');" onmouseover="change(this);" onmouseout="revert(this);">Sample Code</a></h4>
|
||||
<div id="sample"><pre>
|
||||
#include <boost/preprocessor/arithmetic/dec.hpp>
|
||||
#include <boost/preprocessor/arithmetic/div.hpp>
|
||||
#include <boost/preprocessor/control/while.hpp>
|
||||
#include <boost/preprocessor/tuple/elem.hpp>
|
||||
|
||||
#define PRED(d, data) BOOST_PP_TUPLE_ELEM(2, 0, data)
|
||||
|
||||
#define OP(d, data) /* ............... */ \
|
||||
( \
|
||||
BOOST_PP_DEC( \
|
||||
BOOST_PP_TUPLE_ELEM(2, 0, data) \
|
||||
), \
|
||||
BOOST_PP_DIV_D( \
|
||||
d, \
|
||||
BOOST_PP_TUPLE_ELEM(2, 1, data), \
|
||||
2 \
|
||||
) \
|
||||
) \
|
||||
/**/
|
||||
|
||||
// halve 'x' 'n' times
|
||||
#define HALVE(x, n) BOOST_PP_TUPLE_ELEM(2, 1, BOOST_PP_WHILE(PRED, OP, (n, x)))
|
||||
|
||||
HALVE(8, 2) // expands to 2
|
||||
HALVE(16, 1) // expands to 8
|
||||
<pre></div>
|
||||
</body>
|
||||
</html>
|
36
docs.1/ref/empty.html
Normal file
36
docs.1/ref/empty.html
Normal file
@ -0,0 +1,36 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>BOOST_PP_EMPTY</title>
|
||||
<link rel="stylesheet" type="text/css" href="../styles.css">
|
||||
<script language="javascript" type="text/javascript" src="../scripts.js"></script>
|
||||
</head>
|
||||
<body onload="init('sample');">
|
||||
<div style="margin-left: 0px;">
|
||||
The <b>BOOST_PP_EMPTY</b> macro is a nullary utility macro that expands to nothing.
|
||||
</div>
|
||||
<h4>Usage</h4>
|
||||
<div class="code">
|
||||
<b>BOOST_PP_EMPTY</b>()
|
||||
</div>
|
||||
<h4>Remarks</h4>
|
||||
<div>
|
||||
This macro is helps avoid inefficient macro-expansion.
|
||||
It is primarily useful as arguments to <b>BOOST_PP_IF</b> or <b>BOOST_PP_IIF</b>.
|
||||
</div>
|
||||
<h4>Requirements</h4>
|
||||
<div>
|
||||
<b>Header:</b> <a href="../headers/facilities/empty.hpp.html"><boost/preprocessor/facilities/empty.hpp></a>
|
||||
</div>
|
||||
<h4><a class="local" onclick="toggle('sample');" onmouseover="change(this);" onmouseout="revert(this);">Sample Code</a></h4>
|
||||
<div id="sample"><pre>
|
||||
#include <boost/preprocessor/control/if.hpp>
|
||||
#include <boost/preprocessor/facilities/empty.hpp>
|
||||
|
||||
#define X() result
|
||||
#define MACRO(c) BOOST_PP_IF(c, X, BOOST_PP_EMPTY)()
|
||||
|
||||
MACRO(0) // expands to nothing
|
||||
MACRO(1) // expands to result
|
||||
<pre></div>
|
||||
</body>
|
||||
</html>
|
70
docs.1/ref/enum.html
Normal file
70
docs.1/ref/enum.html
Normal file
@ -0,0 +1,70 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>BOOST_PP_ENUM</title>
|
||||
<link rel="stylesheet" type="text/css" href="../styles.css">
|
||||
<script language="javascript" type="text/javascript" src="../scripts.js"></script>
|
||||
</head>
|
||||
<body onload="init('sample');">
|
||||
<div style="margin-left: 0px;">
|
||||
The <b>BOOST_PP_ENUM</b> macro generates a comma-separated list.
|
||||
</div>
|
||||
<h4>Usage</h4>
|
||||
<div class="code">
|
||||
<b>BOOST_PP_ENUM</b>(<i>count</i>, <i>macro</i>, <i>data</i>)
|
||||
</div>
|
||||
<h4>Arguments</h4>
|
||||
<dl>
|
||||
<dt>count</dt>
|
||||
<dd>
|
||||
The number of repetitious calls to <i>macro</i>.
|
||||
Valid values range from <i>0</i> to <b>BOOST_PP_LIMIT_REPEAT</b>.
|
||||
</dd>
|
||||
<dt>macro</dt>
|
||||
<dd class="incompatibility">
|
||||
A ternary operation of the form <i>macro</i>(<i>z</i>, <i>n</i>, <i>data</i>).
|
||||
This macro is expanded by <b>BOOST_PP_ENUM</b> with the next available repetition depth,
|
||||
the current repetition number, and the auxiliary <i>data</i> argument.
|
||||
</dd>
|
||||
<dt>data</dt>
|
||||
<dd>
|
||||
Auxiliary data passed to <i>macro</i>.
|
||||
</dd>
|
||||
</dl>
|
||||
<h4>Remarks</h4>
|
||||
<div>
|
||||
This macro expands to the comma-separated sequence:
|
||||
<div class="incompatibility">
|
||||
<i>macro</i>(<i>z</i>, <i>0</i>, <i>data</i>), <i>macro</i>(<i>z</i>, <i>1</i>, <i>data</i>), ... <i>macro</i>(<i>z</i>, <i>count</i> - <i>1</i>, <i>data</i>)
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
The <i>z</i> value that is passed to <i>macro</i> represents the next available repetition dimension.
|
||||
Other macros that have <b>_Z</b> suffix variants internally use <b>BOOST_PP_REPEAT</b>--for example, <b>BOOST_PP_ENUM_PARAMS</b> and <b>BOOST_PP_ENUM_PARAMS_Z</b>.
|
||||
Using these <b>_Z</b> versions is not strictly necessary, but passing the <i>z</i> value (that is passed to <i>macro</i>) to these macros allows them to reenter <b>BOOST_PP_REPEAT</b> with maximum efficiency.
|
||||
</div>
|
||||
<div>
|
||||
To directly use this <i>z</i> value, rather than simply passing it to another macro, see <b>BOOST_PP_ENUM_<i>z</i></b>.
|
||||
</div>
|
||||
<div>
|
||||
Previously, this macro could not be used recursively inside <b>BOOST_PP_REPEAT</b>.
|
||||
This limitation no longer exists, as the library can automatically detect the next available repetition depth.
|
||||
</div>
|
||||
<h4>See Also</h4>
|
||||
<ul>
|
||||
<li><a href="enum_z.html">BOOST_PP_ENUM_<i>z</i></a></li>
|
||||
<li><a href="limit_repeat.html">BOOST_PP_LIMIT_REPEAT</a></li>
|
||||
</ul>
|
||||
<h4>Requirements</h4>
|
||||
<div>
|
||||
<b>Header:</b> <a href="../headers/repetition/enum.hpp.html"><boost/preprocessor/repetition/enum.hpp></a>
|
||||
</div>
|
||||
<h4><a class="local" onclick="toggle('sample');" onmouseover="change(this);" onmouseout="revert(this);">Sample Code</a></h4>
|
||||
<div id="sample"><pre>
|
||||
#include <boost/preprocessor/repetition/enum.hpp>
|
||||
|
||||
#define TEXT(z, n, text) text
|
||||
|
||||
BOOST_PP_ENUM(4, TEXT, class) // expands to class, class, class, class
|
||||
<pre></div>
|
||||
</body>
|
||||
</html>
|
66
docs.1/ref/enum_binary_params.html
Normal file
66
docs.1/ref/enum_binary_params.html
Normal file
@ -0,0 +1,66 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>BOOST_PP_ENUM_BINARY_PARAMS</title>
|
||||
<link rel="stylesheet" type="text/css" href="../styles.css">
|
||||
<script language="javascript" type="text/javascript" src="../scripts.js"></script>
|
||||
</head>
|
||||
<body onload="init('sample');">
|
||||
<div style="margin-left: 0px;">
|
||||
The <b>BOOST_PP_ENUM_BINARY_PARAMS</b> macro generates a comma-separated list of binary parameters.
|
||||
</div>
|
||||
<h4>Usage</h4>
|
||||
<div class="code">
|
||||
<b>BOOST_PP_ENUM_BINARY_PARAMS</b>(<i>count</i>, <i>p1</i>, <i>p2</i>)
|
||||
</div>
|
||||
<h4>Arguments</h4>
|
||||
<dl>
|
||||
<dt>count</dt>
|
||||
<dd>
|
||||
The number of parameters to generate.
|
||||
Valid values range from <i>0</i> to <b>BOOST_PP_LIMIT_REPEAT</b>.
|
||||
</dd>
|
||||
<dt>p1</dt>
|
||||
<dd>
|
||||
The text of the first part of the parameter.
|
||||
<b>BOOST_PP_ENUM_BINARY_PARAMS</b> concatenates numbers ranging from <i>0</i> to <i>count</i> - <i>1</i>
|
||||
to generate parameters.
|
||||
</dd>
|
||||
<dt>p2</dt>
|
||||
<dd>
|
||||
The text of the first part of the parameter.
|
||||
<b>BOOST_PP_ENUM_BINARY_PARAMS</b> concatenates numbers ranging from <i>0</i> to <i>count</i> - <i>1</i>
|
||||
to generate parameters.
|
||||
</dd>
|
||||
</dl>
|
||||
<h4>Remarks</h4>
|
||||
<div>
|
||||
This macro expands to the comma-separated sequence:
|
||||
<div>
|
||||
<i>p1</i> ## <i>0</i> <i>p2</i> ## <i>0</i>, <i>p1</i> ## <i>1</i> <i>p2</i> ## <i>1</i>, ... <i>p1</i> ## <i>count</i> - <i>1</i> <i>p2</i> ## <i>count</i> - <i>1</i>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
To use the <i>z</i> parameter passed from other macros that use <b>BOOST_PP_REPEAT</b>, see <b>BOOST_PP_ENUM_BINARY_PARAMS_Z</b>.
|
||||
</div>
|
||||
<div>
|
||||
This macro is a replacement for both <b>BOOST_PP_ENUM_PARAMS_WITH_A_DEFAULT</b> and <b>BOOST_PP_ENUM_PARAMS_WITH_DEFAULTS</b>.
|
||||
</div>
|
||||
<h4>See Also</h4>
|
||||
<ul>
|
||||
<li><a href="enum_binary_params_z.html">BOOST_PP_ENUM_BINARY_PARAMS_<i>z</i></a></li>
|
||||
<li><a href="enum_params_with_a_default.html">BOOST_PP_ENUM_PARAMS_WITH_A_DEFAULT</a></li>
|
||||
<li><a href="enum_params_with_defaults.html">BOOST_PP_ENUM_PARAMS_WITH_DEFAULTS</a></li>
|
||||
<li><a href="limit_repeat.html">BOOST_PP_LIMIT_REPEAT</a></li>
|
||||
</ul>
|
||||
<h4>Requirements</h4>
|
||||
<div>
|
||||
<b>Header:</b> <a href="../headers/repetition/enum_binary_params.hpp.html"><boost/preprocessor/repetition/enum_binary_params.hpp></a>
|
||||
</div>
|
||||
<h4><a class="local" onclick="toggle('sample');" onmouseover="change(this);" onmouseout="revert(this);">Sample Code</a></h4>
|
||||
<div id="sample"><pre>
|
||||
#include <boost/preprocessor/repetition/enum_binary_params.hpp>
|
||||
|
||||
BOOST_PP_ENUM_BINARY_PARAMS(3, T, p) // expands to T0 p0, T1 p1, T2 p2
|
||||
<pre></div>
|
||||
</body>
|
||||
</html>
|
83
docs.1/ref/enum_binary_params_z.html
Normal file
83
docs.1/ref/enum_binary_params_z.html
Normal file
@ -0,0 +1,83 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>BOOST_PP_ENUM_BINARY_PARAMS_Z</title>
|
||||
<link rel="stylesheet" type="text/css" href="../styles.css">
|
||||
<script language="javascript" type="text/javascript" src="../scripts.js"></script>
|
||||
</head>
|
||||
<body onload="init('sample');">
|
||||
<div style="margin-left: 0px;">
|
||||
The <b>BOOST_PP_ENUM_BINARY_PARAMS_Z</b> macro generates a comma-separated list of binary parameters.
|
||||
It reenters <b>BOOST_PP_REPEAT</b> with maximum efficiency.
|
||||
</div>
|
||||
<h4>Usage</h4>
|
||||
<div class="code">
|
||||
<b>BOOST_PP_ENUM_BINARY_PARAMS_Z</b>(<i>z</i>, <i>count</i>, <i>p1</i>, <i>p2</i>)
|
||||
</div>
|
||||
<h4>Arguments</h4>
|
||||
<dl>
|
||||
<dt>z</dt>
|
||||
<dd>
|
||||
The next available <b>BOOST_PP_REPEAT</b> dimension.
|
||||
</dd>
|
||||
<dt>count</dt>
|
||||
<dd>
|
||||
The number of parameters to generate.
|
||||
Valid values range from <i>0</i> to <b>BOOST_PP_LIMIT_REPEAT</b>.
|
||||
</dd>
|
||||
<dt>p1</dt>
|
||||
<dd>
|
||||
The text of the first part of the parameter.
|
||||
<b>BOOST_PP_ENUM_BINARY_PARAMS</b> concatenates numbers ranging from <i>0</i> to <i>count</i> - <i>1</i>
|
||||
to generate parameters.
|
||||
</dd>
|
||||
<dt>p2</dt>
|
||||
<dd>
|
||||
The text of the first part of the parameter.
|
||||
<b>BOOST_PP_ENUM_BINARY_PARAMS</b> concatenates numbers ranging from <i>0</i> to <i>count</i> - <i>1</i>
|
||||
to generate parameters.
|
||||
</dd>
|
||||
</dl>
|
||||
<h4>Remarks</h4>
|
||||
<div>
|
||||
This macro expands to the comma-separated sequence:
|
||||
<div>
|
||||
<i>p1</i> ## <i>0</i> <i>p2</i> ## <i>0</i>, <i>p1</i> ## <i>1</i> <i>p2</i> ## <i>1</i>, ... <i>p1</i> ## <i>count</i> - <i>1</i> <i>p2</i> ## <i>count</i> - <i>1</i>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
This macro is a replacement for both <b>BOOST_PP_ENUM_PARAMS_WITH_A_DEFAULT</b> and <b>BOOST_PP_ENUM_PARAMS_WITH_DEFAULTS</b>.
|
||||
</div>
|
||||
<h4>See Also</h4>
|
||||
<ul>
|
||||
<li><a href="enum_binary_params.html">BOOST_PP_ENUM_BINARY_PARAMS</a></li>
|
||||
<li><a href="enum_params_with_a_default.html">BOOST_PP_ENUM_PARAMS_WITH_A_DEFAULT</a></li>
|
||||
<li><a href="enum_params_with_defaults.html">BOOST_PP_ENUM_PARAMS_WITH_DEFAULTS</a></li>
|
||||
<li><a href="limit_repeat.html">BOOST_PP_LIMIT_REPEAT</a></li>
|
||||
</ul>
|
||||
<h4>Requirements</h4>
|
||||
<div>
|
||||
<b>Header:</b> <a href="../headers/repetition/enum_binary_params.hpp.html"><boost/preprocessor/repetition/enum_binary_params.hpp></a>
|
||||
</div>
|
||||
<h4><a class="local" onclick="toggle('sample');" onmouseover="change(this);" onmouseout="revert(this);">Sample Code</a></h4>
|
||||
<div id="sample"><pre>
|
||||
#include <boost/preprocessor/arithmetic/inc.hpp>
|
||||
#include <boost/preprocessor/repetition/enum_binary_params.hpp>
|
||||
#include <boost/preprocessor/repetition/enum_params.hpp>
|
||||
|
||||
#define FUNCTION(z, n, _) \
|
||||
template<BOOST_PP_ENUM_PARAMS_Z(z, BOOST_PP_INC(n), class T)> \
|
||||
void f(BOOST_PP_ENUM_BINARY_PARAMS_Z(z, BOOST_PP_INC(n), T, p)) { \
|
||||
/* ... */ \
|
||||
} \
|
||||
/**/
|
||||
|
||||
BOOST_PP_REPEAT(2, FUNCTION, nil)
|
||||
/*
|
||||
expands to...
|
||||
|
||||
template<class T0> void f(T0 p0) { }
|
||||
template<class T0, class T1> void f(T0 p0, T1 p1) { }
|
||||
*/
|
||||
<pre></div>
|
||||
</body>
|
||||
</html>
|
59
docs.1/ref/enum_params.html
Normal file
59
docs.1/ref/enum_params.html
Normal file
@ -0,0 +1,59 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>BOOST_PP_ENUM_PARAMS</title>
|
||||
<link rel="stylesheet" type="text/css" href="../styles.css">
|
||||
<script language="javascript" type="text/javascript" src="../scripts.js"></script>
|
||||
</head>
|
||||
<body onload="init('sample');">
|
||||
<div style="margin-left: 0px;">
|
||||
The <b>BOOST_PP_ENUM_PARAMS</b> macro generates a comma-separated list of parameters.
|
||||
</div>
|
||||
<h4>Usage</h4>
|
||||
<div class="code">
|
||||
<b>BOOST_PP_ENUM_PARAMS</b>(<i>count</i>, <i>param</i>)
|
||||
</div>
|
||||
<h4>Arguments</h4>
|
||||
<dl>
|
||||
<dt>count</dt>
|
||||
<dd>
|
||||
The number of parameters to generate.
|
||||
Valid values range from <i>0</i> to <b>BOOST_PP_LIMIT_REPEAT</b>.
|
||||
</dd>
|
||||
<dt>param</dt>
|
||||
<dd>
|
||||
The text of the parameter.
|
||||
<b>BOOST_PP_ENUM_PARAMS</b> concatenates numbers ranging from <i>0</i> to <i>count</i> - <i>1</i>
|
||||
to generate parameters.
|
||||
</dd>
|
||||
</dl>
|
||||
<h4>Remarks</h4>
|
||||
<div>
|
||||
This macro expands to the comma-separated sequence:
|
||||
<div>
|
||||
<i>param</i> ## <i>0</i>, <i>param</i> ## <i>1</i>, ... <i>param</i> ## <i>count</i> - <i>1</i>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
To use the <i>z</i> parameter passed from other macros that use <b>BOOST_PP_REPEAT</b>, see <b>BOOST_PP_ENUM_PARAMS_Z</b>.
|
||||
</div>
|
||||
<div>
|
||||
Previously, this macro could not be used recursively inside <b>BOOST_PP_REPEAT</b>.
|
||||
This limitation no longer exists, as the library can automatically detect the next available repetition depth.
|
||||
</div>
|
||||
<h4>See Also</h4>
|
||||
<ul>
|
||||
<li><a href="enum_params_z.html">BOOST_PP_ENUM_PARAMS_<i>z</i></a></li>
|
||||
<li><a href="limit_repeat.html">BOOST_PP_LIMIT_REPEAT</a></li>
|
||||
</ul>
|
||||
<h4>Requirements</h4>
|
||||
<div>
|
||||
<b>Header:</b> <a href="../headers/repetition/enum_params.hpp.html"><boost/preprocessor/repetition/enum_params.hpp></a>
|
||||
</div>
|
||||
<h4><a class="local" onclick="toggle('sample');" onmouseover="change(this);" onmouseout="revert(this);">Sample Code</a></h4>
|
||||
<div id="sample"><pre>
|
||||
#include <boost/preprocessor/repetition/enum_params.hpp>
|
||||
|
||||
BOOST_PP_ENUM_PARAMS(3, class T) // expands to class T0, class T1, class T2
|
||||
<pre></div>
|
||||
</body>
|
||||
</html>
|
73
docs.1/ref/enum_params_with_a_default.html
Normal file
73
docs.1/ref/enum_params_with_a_default.html
Normal file
@ -0,0 +1,73 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>BOOST_PP_ENUM_PARAMS_WITH_A_DEFAULT</title>
|
||||
<link rel="stylesheet" type="text/css" href="../styles.css">
|
||||
<script language="javascript" type="text/javascript" src="../scripts.js"></script>
|
||||
</head>
|
||||
<body onload="init('sample');">
|
||||
<div style="margin-left: 0px;">
|
||||
The <b>BOOST_PP_ENUM_PARAMS_WITH_A_DEFAULT</b> macro generates a comma-separated list of parameters with a default argument.
|
||||
</div>
|
||||
<h4>Usage</h4>
|
||||
<div class="code">
|
||||
<b>BOOST_PP_ENUM_PARAMS_WITH_A_DEFAULT</b>(<i>count</i>, <i>param</i>, <i>def</i>)
|
||||
</div>
|
||||
<h4>Arguments</h4>
|
||||
<dl>
|
||||
<dt>count</dt>
|
||||
<dd>
|
||||
The number of parameters to generate.
|
||||
Valid values range from <i>0</i> to <b>BOOST_PP_LIMIT_REPEAT</b>.
|
||||
</dd>
|
||||
<dt>param</dt>
|
||||
<dd>
|
||||
The text of the parameter.
|
||||
<b>BOOST_PP_ENUM_PARAMS_WITH_A_DEFAULT</b> concatenates numbers ranging from <i>0</i> to <i>count</i> - <i>1</i>
|
||||
to generate parameters.
|
||||
</dd>
|
||||
<dt>def</dt>
|
||||
<dd>
|
||||
The default value that trails each parameter.
|
||||
</dd>
|
||||
</dl>
|
||||
<h4>Remarks</h4>
|
||||
<div>
|
||||
This macro expands to the comma-separated sequence:
|
||||
<div>
|
||||
<i>param</i> ## <i>0</i> = <i>def</i>, <i>param</i> ## <i>1</i> = <i>def</i>, ... <i>param</i> ## <i>count</i> - <i>1</i> = <i>def</i>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
Previously, this macro could not be used recursively inside <b>BOOST_PP_REPEAT</b>.
|
||||
This limitation no longer exists, as the library can automatically detect the next available repetition depth.
|
||||
</div>
|
||||
<div>
|
||||
This macro is deprecated.
|
||||
It only exists for backward compatibility.
|
||||
Use <b>BOOST_PP_ENUM_BINARY_PARAMS</b> with <b>BOOST_PP_INTERCEPT</b> instead:
|
||||
<div>
|
||||
<b>BOOST_PP_ENUM_BINARY_PARAMS</b>(<i>count</i>, <i>param</i>, = <i>def</i> <b>BOOST_PP_INTERCEPT</b>)
|
||||
</div>
|
||||
</div>
|
||||
<h4>See Also</h4>
|
||||
<ul>
|
||||
<li><a href="enum_binary_params.html">BOOST_PP_ENUM_BINARY_PARAMS</a></li>
|
||||
<li><a href="intercept.html">BOOST_PP_INTERCEPT</a></li>
|
||||
<li><a href="limit_repeat.html">BOOST_PP_LIMIT_REPEAT</a></li>
|
||||
</ul>
|
||||
<h4>Requirements</h4>
|
||||
<div>
|
||||
<b>Header:</b> <a href="../headers/repetition/enum_params_with_a_default.hpp.html"><boost/preprocessor/repetition/enum_params_with_a_default.hpp></a>
|
||||
</div>
|
||||
<h4><a class="local" onclick="toggle('sample');" onmouseover="change(this);" onmouseout="revert(this);">Sample Code</a></h4>
|
||||
<div id="sample"><pre>
|
||||
#include <boost/preprocessor/repetition/enum_params_with_a_default.hpp>
|
||||
|
||||
BOOST_PP_ENUM_PARAMS_WITH_A_DEFAULT(3, class T, int)
|
||||
// expands to T0 = int, T1 = int, T2 = int
|
||||
|
||||
BOOST_PP_ENUM_BINARY_PARAMS(3, class T, = int BOOST_PP_INTERCEPT)
|
||||
// expands to T0 = int, T1 = int, T2 = int
|
||||
<pre></div>
|
||||
</body>
|
||||
</html>
|
74
docs.1/ref/enum_params_with_defaults.html
Normal file
74
docs.1/ref/enum_params_with_defaults.html
Normal file
@ -0,0 +1,74 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>BOOST_PP_ENUM_PARAMS_WITH_DEFAULTS</title>
|
||||
<link rel="stylesheet" type="text/css" href="../styles.css">
|
||||
<script language="javascript" type="text/javascript" src="../scripts.js"></script>
|
||||
</head>
|
||||
<body onload="init('sample');">
|
||||
<div style="margin-left: 0px;">
|
||||
The <b>BOOST_PP_ENUM_PARAMS_WITH_DEFAULTS</b> macro generates a comma-separated list of parameters with default arguments.
|
||||
</div>
|
||||
<h4>Usage</h4>
|
||||
<div class="code">
|
||||
<b>BOOST_PP_ENUM_PARAMS_WITH_DEFAULTS</b>(<i>count</i>, <i>param</i>, <i>def</i>)
|
||||
</div>
|
||||
<h4>Arguments</h4>
|
||||
<dl>
|
||||
<dt>count</dt>
|
||||
<dd>
|
||||
The number of parameters to generate.
|
||||
Valid values range from <i>0</i> to <b>BOOST_PP_LIMIT_REPEAT</b>.
|
||||
</dd>
|
||||
<dt>param</dt>
|
||||
<dd>
|
||||
The text of the parameter.
|
||||
<b>BOOST_PP_ENUM_PARAMS_WITH_DEFAULTS</b> concatenates numbers ranging from <i>0</i> to <i>count</i> - <i>1</i>
|
||||
to generate parameters.
|
||||
</dd>
|
||||
<dt>def</dt>
|
||||
<dd>
|
||||
The default value that trails each parameter.
|
||||
<b>BOOST_PP_ENUM_PARAMS_WITH_DEFAULTS</b> concatenates numbers ranging from <i>0</i> to <i>count</i> - <i>1</i>
|
||||
to generate default arguments.
|
||||
</dd>
|
||||
</dl>
|
||||
<h4>Remarks</h4>
|
||||
<div>
|
||||
This macro expands to the comma-separated sequence:
|
||||
<div>
|
||||
<i>param</i> ## <i>0</i> = <i>def</i> ## <i>0</i>, <i>param</i> ## <i>1</i> = <i>def</i> ## <i>1</i>, ... <i>param</i> ## <i>count</i> - <i>1</i> = <i>def</i> ## <i>count</i> - <i>1</i>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
Previously, this macro could not be used recursively inside <b>BOOST_PP_REPEAT</b>.
|
||||
This limitation no longer exists, as the library can automatically detect the next available repetition depth.
|
||||
</div>
|
||||
<div>
|
||||
This macro is deprecated.
|
||||
It only exists for backward compatibility.
|
||||
Use <b>BOOST_PP_ENUM_BINARY_PARAMS</b> instead:
|
||||
<div>
|
||||
<b>BOOST_PP_ENUM_BINARY_PARAMS</b>(<i>count</i>, <i>param</i>, = <i>def</i>)
|
||||
</div>
|
||||
</div>
|
||||
<h4>See Also</h4>
|
||||
<ul>
|
||||
<li><a href="enum_binary_params.html">BOOST_PP_ENUM_BINARY_PARAMS</a></li>
|
||||
<li><a href="limit_repeat.html">BOOST_PP_LIMIT_REPEAT</a></li>
|
||||
</ul>
|
||||
<h4>Requirements</h4>
|
||||
<div>
|
||||
<b>Header:</b> <a href="../headers/repetition/enum_params_with_defaults.hpp.html"><boost/preprocessor/repetition/enum_params_with_defaults.hpp></a>
|
||||
</div>
|
||||
<h4><a class="local" onclick="toggle('sample');" onmouseover="change(this);" onmouseout="revert(this);">Sample Code</a></h4>
|
||||
<div id="sample"><pre>
|
||||
#include <boost/preprocessor/repetition/enum_params_with_defaults.hpp>
|
||||
|
||||
BOOST_PP_ENUM_PARAMS_WITH_DEFAULTS(3, class T, U)
|
||||
// expands to T0 = U0, T1 = U1, T2 = U2
|
||||
|
||||
BOOST_PP_ENUM_BINARY_PARAMS(3, class T, = U)
|
||||
// expands to T0 = U0, T1 = U1, T2 = U2
|
||||
<pre></div>
|
||||
</body>
|
||||
</html>
|
72
docs.1/ref/enum_params_z.html
Normal file
72
docs.1/ref/enum_params_z.html
Normal file
@ -0,0 +1,72 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>BOOST_PP_ENUM_PARAMS_Z</title>
|
||||
<link rel="stylesheet" type="text/css" href="../styles.css">
|
||||
<script language="javascript" type="text/javascript" src="../scripts.js"></script>
|
||||
</head>
|
||||
<body onload="init('sample');">
|
||||
<div style="margin-left: 0px;">
|
||||
The <b>BOOST_PP_ENUM_PARAMS_Z</b> macro generates a comma-separated list of parameters.
|
||||
It reenters <b>BOOST_PP_REPEAT</b> with maximum efficiency.
|
||||
</div>
|
||||
<h4>Usage</h4>
|
||||
<div class="code">
|
||||
<b>BOOST_PP_ENUM_PARAMS_Z</b>(<i>z</i>, <i>count</i>, <i>param</i>)
|
||||
</div>
|
||||
<h4>Arguments</h4>
|
||||
<dl>
|
||||
<dt>z</dt>
|
||||
<dd>
|
||||
The next available <b>BOOST_PP_REPEAT</b> dimension.
|
||||
</dd>
|
||||
<dt>count</dt>
|
||||
<dd>
|
||||
The number of parameters to generate.
|
||||
Valid values range from <i>0</i> to <b>BOOST_PP_LIMIT_REPEAT</b>.
|
||||
</dd>
|
||||
<dt>param</dt>
|
||||
<dd>
|
||||
The text of the parameter.
|
||||
<b>BOOST_PP_ENUM_PARAMS_Z</b> concatenates numbers ranging from <i>0</i> to <i>count</i> - <i>1</i>
|
||||
to generate parameters.
|
||||
</dd>
|
||||
</dl>
|
||||
<h4>Remarks</h4>
|
||||
<div>
|
||||
This macro expands to the comma-separated sequence:
|
||||
<div>
|
||||
<i>param</i> ## <i>0</i>, <i>param</i> ## <i>1</i>, ... <i>param</i> ## <i>count</i> - <i>1</i>
|
||||
</div>
|
||||
</div>
|
||||
<h4>See Also</h4>
|
||||
<ul>
|
||||
<li><a href="enum_params.html">BOOST_PP_ENUM_PARAMS</a></li>
|
||||
<li><a href="limit_repeat.html">BOOST_PP_LIMIT_REPEAT</a></li>
|
||||
</ul>
|
||||
<h4>Requirements</h4>
|
||||
<div>
|
||||
<b>Header:</b> <a href="../headers/repetition/enum_params.hpp.html"><boost/preprocessor/repetition/enum_params.hpp></a>
|
||||
</div>
|
||||
<h4><a class="local" onclick="toggle('sample');" onmouseover="change(this);" onmouseout="revert(this);">Sample Code</a></h4>
|
||||
<div id="sample"><pre>
|
||||
#include <boost/preprocessor/arithmetic/inc.hpp>
|
||||
#include <boost/preprocessor/repetition/enum_params.hpp>
|
||||
#include <boost/preprocessor/repetition/repeat.hpp>
|
||||
|
||||
#define MACRO(z, n, _) /* ............................ */ \
|
||||
template< \
|
||||
BOOST_PP_ENUM_PARAMS_Z(z, BOOST_PP_INC(n), class T) \
|
||||
> class X ## n { \
|
||||
/* ... */ \
|
||||
}; \
|
||||
/**/
|
||||
|
||||
BOOST_PP_REPEAT(2, MACRO, nil)
|
||||
/*
|
||||
expands to...
|
||||
template<class T0> class X0 { };
|
||||
template<class T0, class T1> class X1 { };
|
||||
*/
|
||||
<pre></div>
|
||||
</body>
|
||||
</html>
|
72
docs.1/ref/enum_shifted.html
Normal file
72
docs.1/ref/enum_shifted.html
Normal file
@ -0,0 +1,72 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>BOOST_PP_ENUM_SHIFTED</title>
|
||||
<link rel="stylesheet" type="text/css" href="../styles.css">
|
||||
<script language="javascript" type="text/javascript" src="../scripts.js"></script>
|
||||
</head>
|
||||
<body onload="init('sample');">
|
||||
<div style="margin-left: 0px;">
|
||||
The <b>BOOST_PP_ENUM_SHIFTED</b> macro generates a comma-separated, shifted list.
|
||||
</div>
|
||||
<h4>Usage</h4>
|
||||
<div class="code">
|
||||
<b>BOOST_PP_ENUM_SHIFTED</b>(<i>count</i>, <i>macro</i>, <i>data</i>)
|
||||
</div>
|
||||
<h4>Arguments</h4>
|
||||
<dl>
|
||||
<dt>count</dt>
|
||||
<dd>
|
||||
The number of repetitious calls to <i>macro</i>.
|
||||
Valid values range from <i>0</i> to <b>BOOST_PP_LIMIT_REPEAT</b>.
|
||||
</dd>
|
||||
<dt>macro</dt>
|
||||
<dd class="incompatibility">
|
||||
A ternary operation of the form <i>macro</i>(<i>z</i>, <i>n</i>, <i>data</i>).
|
||||
This macro is expanded by <b>BOOST_PP_ENUM_SHIFTED</b> with the next available repetition depth,
|
||||
the current repetition number, and the auxiliary <i>data</i> argument.
|
||||
</dd>
|
||||
<dt>data</dt>
|
||||
<dd>
|
||||
Auxiliary data passed to <i>macro</i>.
|
||||
</dd>
|
||||
</dl>
|
||||
<h4>Remarks</h4>
|
||||
<div>
|
||||
This macro expands to the comma-separated sequence:
|
||||
<div class="incompatibility">
|
||||
<i>macro</i>(<i>z</i>, <i>1</i>, <i>data</i>), ... <i>macro</i>(<i>z</i>, <i>count</i> - <i>1</i>, <i>data</i>)
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
The <i>z</i> value that is passed to <i>macro</i> represents the next available repetition dimension.
|
||||
Other macros that have <b>_Z</b> suffix variants internally use <b>BOOST_PP_REPEAT</b>--for example, <b>BOOST_PP_ENUM_PARAMS</b> and <b>BOOST_PP_ENUM_PARAMS_Z</b>.
|
||||
Using these <b>_Z</b> versions is not strictly necessary, but passing the <i>z</i> value (that is passed to <i>macro</i>) to these macros allows them to reenter <b>BOOST_PP_REPEAT</b> with maximum efficiency.
|
||||
</div>
|
||||
<div>
|
||||
To directly use this <i>z</i> value, rather than simply passing it to another macro, see <b>BOOST_PP_ENUM_SHIFTED_<i>z</i></b>.
|
||||
</div>
|
||||
<div>
|
||||
Previously, this macro could not be used recursively inside <b>BOOST_PP_REPEAT</b>.
|
||||
This limitation no longer exists, as the library can automatically detect the next available repetition depth.
|
||||
</div>
|
||||
<h4>See Also</h4>
|
||||
<ul>
|
||||
<li><a href="enum_shifted_z.html">BOOST_PP_ENUM_SHIFTED_<i>z</i></a></li>
|
||||
<li><a href="limit_repeat.html">BOOST_PP_LIMIT_REPEAT</a></li>
|
||||
</ul>
|
||||
<h4>Requirements</h4>
|
||||
<div>
|
||||
<b>Header:</b> <a href="../headers/repetition/enum_shifted.hpp.html"><boost/preprocessor/repetition/enum_shifted.hpp></a>
|
||||
</div>
|
||||
<h4><a class="local" onclick="toggle('sample');" onmouseover="change(this);" onmouseout="revert(this);">Sample Code</a></h4>
|
||||
<div id="sample"><pre>
|
||||
#include <boost/preprocessor/repetition/enum.hpp>
|
||||
#include <boost/preprocessor/repetition/enum_shifted.hpp>
|
||||
|
||||
#define TYPE(z, n, type) type
|
||||
|
||||
BOOST_PP_ENUM(5, TYPE, int) // expands to int, int, int, int, int
|
||||
BOOST_PP_ENUM_SHIFTED(5, TYPE, int) // expands to int, int, int, int
|
||||
<pre></div>
|
||||
</body>
|
||||
</html>
|
63
docs.1/ref/enum_shifted_params.html
Normal file
63
docs.1/ref/enum_shifted_params.html
Normal file
@ -0,0 +1,63 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>BOOST_PP_ENUM_SHIFTED_PARAMS</title>
|
||||
<link rel="stylesheet" type="text/css" href="../styles.css">
|
||||
<script language="javascript" type="text/javascript" src="../scripts.js"></script>
|
||||
</head>
|
||||
<body onload="init('sample');">
|
||||
<div style="margin-left: 0px;">
|
||||
The <b>BOOST_PP_ENUM_SHIFTED_PARAMS</b> macro generates a comma-separated, shifted list of parameters.
|
||||
</div>
|
||||
<h4>Usage</h4>
|
||||
<div class="code">
|
||||
<b>BOOST_PP_ENUM_SHIFTED_PARAMS</b>(<i>count</i>, <i>param</i>)
|
||||
</div>
|
||||
<h4>Arguments</h4>
|
||||
<dl>
|
||||
<dt>count</dt>
|
||||
<dd>
|
||||
The number of parameters to generate.
|
||||
Valid values range from <i>0</i> to <b>BOOST_PP_LIMIT_REPEAT</b>.
|
||||
</dd>
|
||||
<dt>param</dt>
|
||||
<dd>
|
||||
The text of the parameter.
|
||||
<b>BOOST_PP_ENUM_SHIFTED_PARAMS</b> concatenates numbers ranging from <i>1</i> to <i>count</i> - <i>1</i>
|
||||
to generate parameters.
|
||||
</dd>
|
||||
</dl>
|
||||
<h4>Remarks</h4>
|
||||
<div>
|
||||
This macro expands to the comma-separated sequence:
|
||||
<div>
|
||||
<i>param</i> ## <i>1</i>, ... <i>param</i> ## <i>count</i> - <i>1</i>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
This macro facilitates a typical usage of the library.
|
||||
Shifted parameter lists are common in template metaprograms.
|
||||
</div>
|
||||
<div>
|
||||
To use the <i>z</i> parameter passed from other macros that use <b>BOOST_PP_REPEAT</b>, see <b>BOOST_PP_ENUM_SHIFTED_PARAMS_Z</b>.
|
||||
</div>
|
||||
<div>
|
||||
Previously, this macro could not be used recursively inside <b>BOOST_PP_REPEAT</b>.
|
||||
This limitation no longer exists, as the library can automatically detect the next available repetition depth.
|
||||
</div>
|
||||
<h4>See Also</h4>
|
||||
<ul>
|
||||
<li><a href="limit_repeat.html">BOOST_PP_LIMIT_REPEAT</a></li>
|
||||
<li><a href="enum_shifted_params_z.html">BOOST_PP_SHIFTED_ENUM_PARAMS_<i>z</i></a></li>
|
||||
</ul>
|
||||
<h4>Requirements</h4>
|
||||
<div>
|
||||
<b>Header:</b> <a href="../headers/repetition/enum_shifted_params.hpp.html"><boost/preprocessor/repetition/enum_shifted_params.hpp></a>
|
||||
</div>
|
||||
<h4><a class="local" onclick="toggle('sample');" onmouseover="change(this);" onmouseout="revert(this);">Sample Code</a></h4>
|
||||
<div id="sample"><pre>
|
||||
#include <boost/preprocessor/repetition/enum_shifted_params.hpp>
|
||||
|
||||
BOOST_PP_ENUM_SHIFTED_PARAMS(3, class T) // expands to class T1, class T2
|
||||
<pre></div>
|
||||
</body>
|
||||
</html>
|
69
docs.1/ref/enum_shifted_params_z.html
Normal file
69
docs.1/ref/enum_shifted_params_z.html
Normal file
@ -0,0 +1,69 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>BOOST_PP_ENUM_SHIFTED_PARAMS_Z</title>
|
||||
<link rel="stylesheet" type="text/css" href="../styles.css">
|
||||
<script language="javascript" type="text/javascript" src="../scripts.js"></script>
|
||||
</head>
|
||||
<body onload="init('sample');">
|
||||
<div style="margin-left: 0px;">
|
||||
The <b>BOOST_PP_ENUM_SHIFTED_PARAMS_Z</b> macro generates a comma-separated, shifted list of parameters.
|
||||
It reenters <b>BOOST_PP_REPEAT</b> with maximum efficiency.
|
||||
</div>
|
||||
<h4>Usage</h4>
|
||||
<div class="code">
|
||||
<b>BOOST_PP_ENUM_SHIFTED_PARAMS_Z</b>(<i>z</i>, <i>count</i>, <i>param</i>)
|
||||
</div>
|
||||
<h4>Arguments</h4>
|
||||
<dl>
|
||||
<dt>z</dt>
|
||||
<dd>
|
||||
The next available <b>BOOST_PP_REPEAT</b> dimension.
|
||||
</dd>
|
||||
<dt>count</dt>
|
||||
<dd>
|
||||
The number of parameters to generate.
|
||||
Valid values range from <i>0</i> to <b>BOOST_PP_LIMIT_REPEAT</b>.
|
||||
</dd>
|
||||
<dt>param</dt>
|
||||
<dd>
|
||||
The text of the parameter.
|
||||
<b>BOOST_PP_ENUM_SHIFTED_PARAMS_Z</b> concatenates numbers ranging from <i>1</i> to <i>count</i> - <i>1</i>
|
||||
to generate parameters.
|
||||
</dd>
|
||||
</dl>
|
||||
<h4>Remarks</h4>
|
||||
<div>
|
||||
This macro expands to the comma-separated sequence:
|
||||
<div>
|
||||
<i>param</i> ## <i>1</i>, ... <i>param</i> ## <i>count</i> - <i>1</i>
|
||||
</div>
|
||||
</div>
|
||||
<h4>See Also</h4>
|
||||
<ul>
|
||||
<li><a href="limit_repeat.html">BOOST_PP_LIMIT_REPEAT</a></li>
|
||||
<li><a href="enum_shifted_params.html">BOOST_PP_ENUM_SHIFTED_PARAMS</a></li>
|
||||
</ul>
|
||||
<h4>Requirements</h4>
|
||||
<div>
|
||||
<b>Header:</b> <a href="../headers/repetition/enum_shifted_params.hpp.html"><boost/preprocessor/repetition/enum_shifted_params.hpp></a>
|
||||
</div>
|
||||
<h4><a class="local" onclick="toggle('sample');" onmouseover="change(this);" onmouseout="revert(this);">Sample Code</a></h4>
|
||||
<div id="sample"><pre>
|
||||
#include <boost/preprocessor/repetition/enum_params.hpp>
|
||||
#include <boost/preprocessor/repetition/enum_shifted_params.hpp>
|
||||
#include <boost/preprocessor/repetition/repeat.hpp>
|
||||
|
||||
int add_f(void) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
#define ADD_F(z, n, _) \
|
||||
int add_f(BOOST_PP_ENUM_PARAMS_Z(z, BOOST_PP_INC(n), int p)) { \
|
||||
return p0 + add_f(BOOST_PP_ENUM_SHIFTED_PARAMS_Z(z, BOOST_PP_INC(n), p)); \
|
||||
} \
|
||||
/**/
|
||||
|
||||
BOOST_PP_REPEAT(5, ADD_F, nil)
|
||||
<pre></div>
|
||||
</body>
|
||||
</html>
|
83
docs.1/ref/enum_shifted_z.html
Normal file
83
docs.1/ref/enum_shifted_z.html
Normal file
@ -0,0 +1,83 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>BOOST_PP_ENUM_SHIFTED_z</title>
|
||||
<link rel="stylesheet" type="text/css" href="../styles.css">
|
||||
<script language="javascript" type="text/javascript" src="../scripts.js"></script>
|
||||
</head>
|
||||
<body onload="init('sample');">
|
||||
<div style="margin-left: 0px;">
|
||||
The <b>BOOST_PP_ENUM_SHIFTED_<i>z</i></b> macro represents a reentry into the <b>BOOST_PP_ENUM_SHIFTED</b> repetition construct.
|
||||
</div>
|
||||
<h4>Usage</h4>
|
||||
<div class="code">
|
||||
<b>BOOST_PP_ENUM_SHIFTED_</b> ## <i>z</i>(<i>count</i>, <i>macro</i>, <i>data</i>)
|
||||
</div>
|
||||
<h4>Arguments</h4>
|
||||
<dl>
|
||||
<dt>z</dt>
|
||||
<dd>
|
||||
The next available <b>BOOST_PP_REPEAT</b> dimension.
|
||||
</dd>
|
||||
<dt>count</dt>
|
||||
<dd>
|
||||
The number of repetitious calls to <i>macro</i>.
|
||||
Valid values range from <i>0</i> to <b>BOOST_PP_LIMIT_REPEAT</b>.
|
||||
</dd>
|
||||
<dt>macro</dt>
|
||||
<dd class="incompatibility">
|
||||
A ternary operation of the form <i>macro</i>(<i>z</i>, <i>n</i>, <i>data</i>).
|
||||
This macro is expanded by <b>BOOST_PP_ENUM_SHIFTED</b> with the next available repetition depth,
|
||||
the current repetition number, and the auxiliary <i>data</i> argument.
|
||||
</dd>
|
||||
<dt>data</dt>
|
||||
<dd>
|
||||
Auxiliary data passed to <i>macro</i>.
|
||||
</dd>
|
||||
</dl>
|
||||
<h4>Remarks</h4>
|
||||
<div>
|
||||
This macro expands to the sequence:
|
||||
<div class="incompatibility">
|
||||
<i>macro</i>(<i>z</i>, <i>1</i>, <i>data</i>), ... <i>macro</i>(<i>z</i>, <i>count</i> - <i>1</i>, <i>data</i>)
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
At certain times, it may be necessary to perform the concatenation with <b>BOOST_PP_CAT</b> rather than the preprocessor token-pasting operator.
|
||||
This happens when the <i>z</i> value is a macro invocation itself.
|
||||
It needs a delay to allow it to expand.
|
||||
The syntax in such a scenario becomes:
|
||||
<div>
|
||||
<b>BOOST_PP_CAT</b>(<b>BOOST_PP_ENUM_SHIFTED_</b>, <i>z</i>)(<i>count</i>, <i>macro</i>, <i>data</i>).
|
||||
</div>
|
||||
</div>
|
||||
<h4>See Also</h4>
|
||||
<ul>
|
||||
<li><a href="cat.html">BOOST_PP_CAT</a></li>
|
||||
<li><a href="enum_shifted.html">BOOST_PP_ENUM_SHIFTED</a></li>
|
||||
<li><a href="limit_repeat.html">BOOST_PP_LIMIT_REPEAT</a></li>
|
||||
</ul>
|
||||
<h4>Requirements</h4>
|
||||
<div>
|
||||
<b>Header:</b> <a href="../headers/repetition/enum_shifted.hpp.html"><boost/preprocessor/repetition/enum_shifted.hpp></a>
|
||||
</div>
|
||||
<h4><a class="local" onclick="toggle('sample');" onmouseover="change(this);" onmouseout="revert(this);">Sample Code</a></h4>
|
||||
<div id="sample"><pre>
|
||||
#include <boost/preprocessor/arithmetic/inc.hpp>
|
||||
#include <boost/preprocessor/repetition/enum_shifted.hpp>
|
||||
#include <boost/preprocessor/repetition/repeat.hpp>
|
||||
|
||||
#define TEXT(z, n, text) text
|
||||
|
||||
#define MACRO(z, n, data) /* ... */ \
|
||||
( \
|
||||
BOOST_PP_ENUM_SHIFTED_ ## z( \
|
||||
BOOST_PP_INC(n), \
|
||||
TEXT, data \
|
||||
) \
|
||||
) \
|
||||
/**/
|
||||
|
||||
BOOST_PP_REPEAT(3, MACRO, class) // expands to () (class) (class, class)
|
||||
<pre></div>
|
||||
</body>
|
||||
</html>
|
86
docs.1/ref/enum_z.html
Normal file
86
docs.1/ref/enum_z.html
Normal file
@ -0,0 +1,86 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>BOOST_PP_ENUM_z</title>
|
||||
<link rel="stylesheet" type="text/css" href="../styles.css">
|
||||
<script language="javascript" type="text/javascript" src="../scripts.js"></script>
|
||||
</head>
|
||||
<body onload="init('sample');">
|
||||
<div style="margin-left: 0px;">
|
||||
The <b>BOOST_PP_ENUM_<i>z</i></b> macro represents a reentry into the <b>BOOST_PP_ENUM</b> repetition construct.
|
||||
</div>
|
||||
<h4>Usage</h4>
|
||||
<div class="code">
|
||||
<b>BOOST_PP_ENUM_</b> ## <i>z</i>(<i>count</i>, <i>macro</i>, <i>data</i>)
|
||||
</div>
|
||||
<h4>Arguments</h4>
|
||||
<dl>
|
||||
<dt>z</dt>
|
||||
<dd>
|
||||
The next available <b>BOOST_PP_REPEAT</b> dimension.
|
||||
</dd>
|
||||
<dt>count</dt>
|
||||
<dd>
|
||||
The number of repetitious calls to <i>macro</i>.
|
||||
Valid values range from <i>0</i> to <b>BOOST_PP_LIMIT_REPEAT</b>.
|
||||
</dd>
|
||||
<dt>macro</dt>
|
||||
<dd class="incompatibility">
|
||||
A ternary operation of the form <i>macro</i>(<i>z</i>, <i>n</i>, <i>data</i>).
|
||||
This macro is expanded by <b>BOOST_PP_ENUM</b> with the next available repetition depth,
|
||||
the current repetition number, and the auxiliary <i>data</i> argument.
|
||||
</dd>
|
||||
<dt>data</dt>
|
||||
<dd>
|
||||
Auxiliary data passed to <i>macro</i>.
|
||||
</dd>
|
||||
</dl>
|
||||
<h4>Remarks</h4>
|
||||
<div>
|
||||
This macro expands to the sequence:
|
||||
<div class="incompatibility">
|
||||
<i>macro</i>(<i>z</i>, <i>0</i>, <i>data</i>), <i>macro</i>(<i>z</i>, <i>1</i>, <i>data</i>), ... <i>macro</i>(<i>z</i>, <i>count</i> - <i>1</i>, <i>data</i>)
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
At certain times, it may be necessary to perform the concatenation with <b>BOOST_PP_CAT</b> rather than the preprocessor token-pasting operator.
|
||||
This happens when the <i>z</i> value is a macro invocation itself.
|
||||
It needs a delay to allow it to expand.
|
||||
The syntax in such a scenario becomes:
|
||||
<div>
|
||||
<b>BOOST_PP_CAT</b>(<b>BOOST_PP_ENUM_</b>, <i>z</i>)(<i>count</i>, <i>macro</i>, <i>data</i>)
|
||||
</div>
|
||||
</div>
|
||||
<h4>See Also</h4>
|
||||
<ul>
|
||||
<li><a href="cat.html">BOOST_PP_CAT</a></li>
|
||||
<li><a href="enum.html">BOOST_PP_ENUM</a></li>
|
||||
<li><a href="limit_repeat.html">BOOST_PP_LIMIT_REPEAT</a></li>
|
||||
</ul>
|
||||
<h4>Requirements</h4>
|
||||
<div>
|
||||
<b>Header:</b> <a href="../headers/repetition/enum.hpp.html"><boost/preprocessor/repetition/enum.hpp></a>
|
||||
</div>
|
||||
<h4><a class="local" onclick="toggle('sample');" onmouseover="change(this);" onmouseout="revert(this);">Sample Code</a></h4>
|
||||
<div id="sample"><pre>
|
||||
#include <boost/preprocessor/arithmetic/inc.hpp>
|
||||
#include <boost/preprocessor/repetition/enum.hpp>
|
||||
|
||||
#define TEXT(z, n, text) text
|
||||
|
||||
#define TTP(z, n, _) /* ............................ */ \
|
||||
template< \
|
||||
BOOST_PP_ENUM_ ## z(BOOST_PP_INC(n), TEXT, class) \
|
||||
> \
|
||||
class T ## n \
|
||||
/**/
|
||||
|
||||
BOOST_PP_ENUM(3, TTP, nil)
|
||||
/*
|
||||
expands to...
|
||||
template<class> class T0,
|
||||
template<class, class> class T1,
|
||||
template<class, class, class> class T2
|
||||
*/
|
||||
<pre></div>
|
||||
</body>
|
||||
</html>
|
54
docs.1/ref/equal.html
Normal file
54
docs.1/ref/equal.html
Normal file
@ -0,0 +1,54 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>BOOST_PP_EQUAL</title>
|
||||
<link rel="stylesheet" type="text/css" href="../styles.css">
|
||||
<script language="javascript" type="text/javascript" src="../scripts.js"></script>
|
||||
</head>
|
||||
<body onload="init('sample');">
|
||||
<div style="margin-left: 0px;">
|
||||
The <b>BOOST_PP_EQUAL</b> macro compares two values for equality.
|
||||
</div>
|
||||
<h4>Usage</h4>
|
||||
<div class="code">
|
||||
<b>BOOST_PP_EQUAL</b>(<i>x</i>, <i>y</i>)
|
||||
</div>
|
||||
<h4>Arguments</h4>
|
||||
<dl>
|
||||
<dt>x</dt>
|
||||
<dd>
|
||||
The left operand of the comparison.
|
||||
Valid values range from <i>0</i> to <b>BOOST_PP_LIMIT_MAG</b>.
|
||||
</dd>
|
||||
<dt>y</dt>
|
||||
<dd>
|
||||
The right operand of the comparison.
|
||||
Valid values range from <i>0</i> to <b>BOOST_PP_LIMIT_MAG</b>.
|
||||
</dd>
|
||||
</dl>
|
||||
<h4>Remarks</h4>
|
||||
<div>
|
||||
If <i>x</i> is equal to <i>y</i>, this macro expands to <i>1</i>.
|
||||
Otherwise, it expands to <i>0</i>.
|
||||
</div>
|
||||
<div>
|
||||
Previously, this macro could not be used inside <b>BOOST_PP_WHILE</b>.
|
||||
There is no longer any such restriction because this macro no longer uses <b>BOOST_PP_WHILE</b>.
|
||||
</div>
|
||||
<h4>See Also</h4>
|
||||
<ul>
|
||||
<li><a href="equal_d.html">BOOST_PP_EQUAL_D</a></li>
|
||||
<li><a href="limit_mag.html">BOOST_PP_LIMIT_MAG</a></li>
|
||||
</ul>
|
||||
<h4>Requirements</h4>
|
||||
<div>
|
||||
<b>Header:</b> <a href="../headers/comparison/equal.hpp.html"><boost/preprocessor/comparison/equal.hpp></a>
|
||||
</div>
|
||||
<h4><a class="local" onclick="toggle('sample');" onmouseover="change(this);" onmouseout="revert(this);">Sample Code</a></h4>
|
||||
<div id="sample"><pre>
|
||||
#include <boost/preprocessor/comparison/equal.hpp>
|
||||
|
||||
BOOST_PP_EQUAL(4, 3) // expands to 0
|
||||
BOOST_PP_EQUAL(5, 5) // expands to 1
|
||||
<pre></div>
|
||||
</body>
|
||||
</html>
|
59
docs.1/ref/equal_d.html
Normal file
59
docs.1/ref/equal_d.html
Normal file
@ -0,0 +1,59 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>BOOST_PP_EQUAL_D</title>
|
||||
<link rel="stylesheet" type="text/css" href="../styles.css">
|
||||
<script language="javascript" type="text/javascript" src="../scripts.js"></script>
|
||||
</head>
|
||||
<body onload="init('sample');">
|
||||
<div style="margin-left: 0px;">
|
||||
The <b>BOOST_PP_EQUAL_D</b> macro compares two values for equality.
|
||||
</div>
|
||||
<h4>Usage</h4>
|
||||
<div class="code">
|
||||
<b>BOOST_PP_EQUAL_D</b>(<i>d</i>, <i>x</i>, <i>y</i>)
|
||||
</div>
|
||||
<h4>Arguments</h4>
|
||||
<dl>
|
||||
<dt>d</dt>
|
||||
<dd>
|
||||
This argument is ignored.
|
||||
</dd>
|
||||
<dt>x</dt>
|
||||
<dd>
|
||||
The left operand of the comparison.
|
||||
Valid values range from <i>0</i> to <b>BOOST_PP_LIMIT_MAG</b>.
|
||||
</dd>
|
||||
<dt>y</dt>
|
||||
<dd>
|
||||
The right operand of the comparison.
|
||||
Valid values range from <i>0</i> to <b>BOOST_PP_LIMIT_MAG</b>.
|
||||
</dd>
|
||||
</dl>
|
||||
<h4>Remarks</h4>
|
||||
<div>
|
||||
If <i>x</i> is equal to <i>y</i>, this macro expands to <i>1</i>.
|
||||
Otherwise, it expands to <i>0</i>.
|
||||
</div>
|
||||
<div>
|
||||
This macro is deprecated.
|
||||
It only exists for backward compatibility.
|
||||
Use <b>BOOST_PP_EQUAL</b> instead.
|
||||
</div>
|
||||
<h4>See Also</h4>
|
||||
<ul>
|
||||
<li><a href="equal.html">BOOST_PP_EQUAL</a></li>
|
||||
<li><a href="limit_mag.html">BOOST_PP_LIMIT_MAG</a></li>
|
||||
</ul>
|
||||
<h4>Requirements</h4>
|
||||
<div>
|
||||
<b>Header:</b> <a href="../headers/comparison/equal.hpp.html"><boost/preprocessor/comparison/equal.hpp></a>
|
||||
</div>
|
||||
<h4><a class="local" onclick="toggle('sample');" onmouseover="change(this);" onmouseout="revert(this);">Sample Code</a></h4>
|
||||
<div id="sample"><pre>
|
||||
#include <boost/preprocessor/comparison/equal.hpp>
|
||||
|
||||
BOOST_PP_EQUAL_D(1, 4, 3) // expands to 0
|
||||
BOOST_PP_EQUAL_D(1, 5, 5) // expands to 1
|
||||
<pre></div>
|
||||
</body>
|
||||
</html>
|
57
docs.1/ref/expand.html
Normal file
57
docs.1/ref/expand.html
Normal file
@ -0,0 +1,57 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>BOOST_PP_EXPAND</title>
|
||||
<link rel="stylesheet" type="text/css" href="../styles.css">
|
||||
<script language="javascript" type="text/javascript" src="../scripts.js"></script>
|
||||
</head>
|
||||
<body onload="init('sample');">
|
||||
<div style="margin-left: 0px;">
|
||||
The <b>BOOST_PP_EXPAND</b> macro performs a double macro-expansion on its argument.
|
||||
</div>
|
||||
<h4>Usage</h4>
|
||||
<div class="code">
|
||||
<b>BOOST_PP_EXPAND</b>(<i>x</i>)
|
||||
</div>
|
||||
<h4>Arguments</h4>
|
||||
<dl>
|
||||
<dt>x</dt>
|
||||
<dd>
|
||||
The argument to be expanded twice.
|
||||
</dd>
|
||||
</dl>
|
||||
<h4>Remarks</h4>
|
||||
<div>
|
||||
This macro is useful when a delay is necessary to produce the correct semantics of a macro invocation.
|
||||
For example, when a macro expands to an argument list to another macro.
|
||||
This macro will expand the the argument list on the first pass, and then rescan to expand any more macros.
|
||||
</div>
|
||||
<h4>Requirements</h4>
|
||||
<div>
|
||||
<b>Header:</b> <a href="../headers/facilities/expand.hpp.html"><boost/preprocessor/facilities/expand.hpp></a>
|
||||
</div>
|
||||
<h4><a class="local" onclick="toggle('sample');" onmouseover="change(this);" onmouseout="revert(this);">Sample Code</a></h4>
|
||||
<div id="sample"><pre>
|
||||
#include <boost/preprocessor/control/if.hpp>
|
||||
#include <boost/preprocessor/facilities/expand.hpp>
|
||||
|
||||
#define MACRO(a, b, c) (a)(b)(c)
|
||||
#define ARGS() (1, 2, 3)
|
||||
|
||||
BOOST_PP_EXPAND(MACRO ARGS) // expands to (1)(2)(3)
|
||||
|
||||
#define SAMPLE(n) /* ... */ \
|
||||
BOOST_PP_EXPAND( \
|
||||
MACRO, \
|
||||
BOOST_PP_IF( \
|
||||
n, \
|
||||
(x, y, z), \
|
||||
(a, b, c) \
|
||||
) \
|
||||
) \
|
||||
/**/
|
||||
|
||||
SAMPLE(0) // expands to (a)(b)(c)
|
||||
SAMPLE(1) // expands to (x)(y)(z)
|
||||
<pre></div>
|
||||
</body>
|
||||
</html>
|
60
docs.1/ref/expr_if.html
Normal file
60
docs.1/ref/expr_if.html
Normal file
@ -0,0 +1,60 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>BOOST_PP_EXPR_IF</title>
|
||||
<link rel="stylesheet" type="text/css" href="../styles.css">
|
||||
<script language="javascript" type="text/javascript" src="../scripts.js"></script>
|
||||
</head>
|
||||
<body onload="init('sample');">
|
||||
<div style="margin-left: 0px;">
|
||||
The <b>BOOST_PP_EXPR_IF</b> macro expands to its second argument if its first argument is non-zero or expands to nothing otherwise.
|
||||
</div>
|
||||
<h4>Usage</h4>
|
||||
<div class="code">
|
||||
<b>BOOST_PP_EXPR_IF</b>(<i>cond</i>, <i>expr</i>)
|
||||
</div>
|
||||
<h4>Arguments</h4>
|
||||
<dl>
|
||||
<dt>cond</dt>
|
||||
<dd>
|
||||
The condition that determines if the result is <i>expr</i> or nothing.
|
||||
Valid values range from <i>0</i> to <b>BOOST_PP_LIMIT_MAG</b>.
|
||||
</dd>
|
||||
<dt>expr</dt>
|
||||
<dd>
|
||||
The result of the expansion if <i>cond</i> is non-zero.
|
||||
</dd>
|
||||
</dl>
|
||||
<h4>Remarks</h4>
|
||||
<div>
|
||||
This macro performs a boolean conversion on its first argument.
|
||||
If that conversion is unnecessary, use <b>BOOST_PP_EXPR_IIF</b> instead.
|
||||
</div>
|
||||
<h4>See Also</h4>
|
||||
<ul>
|
||||
<li><a href="expr_iif.html">BOOST_PP_EXPR_IIF</a></li>
|
||||
<li><a href="limit_mag.html">BOOST_PP_LIMIT_MAG</a></li>
|
||||
</ul>
|
||||
<h4>Requirements</h4>
|
||||
<div>
|
||||
<b>Header:</b> <a href="../headers/control/expr_if.hpp.html"><boost/preprocessor/control/expr_if.hpp></a>
|
||||
</div>
|
||||
<h4><a class="local" onclick="toggle('sample');" onmouseover="change(this);" onmouseout="revert(this);">Sample Code</a></h4>
|
||||
<div id="sample"><pre>
|
||||
#include <boost/preprocessor/control/expr_if.hpp>
|
||||
#include <boost/preprocessor/tuple/elem.hpp>
|
||||
|
||||
#define CV(n) /* ........................... */ \
|
||||
BOOST_PP_EXPR_IF( \
|
||||
n, \
|
||||
BOOST_PP_TUPLE_ELEM( \
|
||||
4, n, \
|
||||
(..., const, volatile, const volatile) \
|
||||
) \
|
||||
) \
|
||||
/**/
|
||||
|
||||
CV(0) // expands to nothing
|
||||
CV(1) // expands to const
|
||||
<pre></div>
|
||||
</body>
|
||||
</html>
|
57
docs.1/ref/expr_iif.html
Normal file
57
docs.1/ref/expr_iif.html
Normal file
@ -0,0 +1,57 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>BOOST_PP_EXPR_IIF</title>
|
||||
<link rel="stylesheet" type="text/css" href="../styles.css">
|
||||
<script language="javascript" type="text/javascript" src="../scripts.js"></script>
|
||||
</head>
|
||||
<body onload="init('sample');">
|
||||
<div style="margin-left: 0px;">
|
||||
The <b>BOOST_PP_EXPR_IIF</b> macro expands to its second argument if its first argument is <i>1</i> and expands to nothing if its first argument is <i>0</i>.
|
||||
</div>
|
||||
<h4>Usage</h4>
|
||||
<div class="code">
|
||||
<b>BOOST_PP_EXPR_IIF</b>(<i>bit</i>, <i>expr</i>)
|
||||
</div>
|
||||
<h4>Arguments</h4>
|
||||
<dl>
|
||||
<dt>bit</dt>
|
||||
<dd>
|
||||
The condition that determines if the result is <i>expr</i> or nothing.
|
||||
This value must expand to <i>0</i> or </i>1</i>.
|
||||
</dd>
|
||||
<dt>expr</dt>
|
||||
<dd>
|
||||
The result of the expansion if <i>bit</i> is <i>1</i>.
|
||||
</dd>
|
||||
</dl>
|
||||
<h4>Remarks</h4>
|
||||
<div>
|
||||
This macro <i>does not</i> perform a boolean conversion on its first argument.
|
||||
If that conversion is necessary, use <b>BOOST_PP_EXPR_IF</b> instead.
|
||||
</div>
|
||||
<h4>See Also</h4>
|
||||
<ul>
|
||||
<li><a href="expr_if.html">BOOST_PP_EXPR_IF</a></li>
|
||||
<li><a href="limit_mag.html">BOOST_PP_LIMIT_MAG</a></li>
|
||||
</ul>
|
||||
<h4>Requirements</h4>
|
||||
<div>
|
||||
<b>Header:</b> <a href="../headers/control/expr_iif.hpp.html"><boost/preprocessor/control/expr_iif.hpp></a>
|
||||
</div>
|
||||
<h4><a class="local" onclick="toggle('sample');" onmouseover="change(this);" onmouseout="revert(this);">Sample Code</a></h4>
|
||||
<div id="sample"><pre>
|
||||
#include <boost/preprocessor/comparison/and.hpp>
|
||||
#include <boost/preprocessor/control/expr_iif.hpp>
|
||||
|
||||
#define INSERT_AND(p, q, text) /* ... */ \
|
||||
BOOST_PP_EXPR_IIF( \
|
||||
BOOST_PP_AND(p, q), \
|
||||
text \
|
||||
) \
|
||||
/**/
|
||||
|
||||
INSERT_AND(2, 3, abc) // expands to abc
|
||||
INSERT_AND(0, 7, xyz) // expands to nothing
|
||||
<pre></div>
|
||||
</body>
|
||||
</html>
|
42
docs.1/ref/filename_x.html
Normal file
42
docs.1/ref/filename_x.html
Normal file
@ -0,0 +1,42 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>BOOST_PP_FILENAME_x</title>
|
||||
<link rel="stylesheet" type="text/css" href="../styles.css">
|
||||
<script language="javascript" type="text/javascript" src="../scripts.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<div style="margin-left: 0px;">
|
||||
The <b>BOOST_PP_FILENAME_<i>x</i></b> macro is a user-defined <i>named external argument</i> used by <b>BOOST_PP_ITERATE</b>.
|
||||
It denotes the file to be iterated over.
|
||||
</div>
|
||||
<h4>Usage</h4>
|
||||
<div class="code">
|
||||
#define <b>BOOST_PP_FILENAME_<i>x</i></b> <i>filename</i>
|
||||
</div>
|
||||
<h4>Arguments</h4>
|
||||
<dl>
|
||||
<dt>x</dt>
|
||||
<dd>
|
||||
The iteration depth of the next <i>file-iteration</i>.
|
||||
This value <i>must</i> be the current iteration depth + <i>1</i>.
|
||||
</dd>
|
||||
<dt>filename</dt>
|
||||
<dd>
|
||||
A quoted or angle-bracketed filename to used as the target of a <i>file-iteration</i>.
|
||||
</dd>
|
||||
</dl>
|
||||
<h4>Remarks</h4>
|
||||
<div>
|
||||
This macro is part of the secondary method of passing arguments to <b>BOOST_PP_ITERATE</b>.
|
||||
The other part is <b>BOOST_PP_ITERATION_LIMITS</b>.
|
||||
</div>
|
||||
<div>
|
||||
This macro is automatically undefined for reuse by a call to <b>BOOST_PP_ITERATE</b>.
|
||||
</div>
|
||||
<h4>See Also</h4>
|
||||
<ul>
|
||||
<li><a href="iterate.html">BOOST_PP_ITERATE</a></li>
|
||||
<li><a href="iteration_limits.html">BOOST_PP_ITERATION_LIMITS</a></li>
|
||||
</ul>
|
||||
</body>
|
||||
</html>
|
95
docs.1/ref/for.html
Normal file
95
docs.1/ref/for.html
Normal file
@ -0,0 +1,95 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>BOOST_PP_FOR</title>
|
||||
<link rel="stylesheet" type="text/css" href="../styles.css">
|
||||
<script language="javascript" type="text/javascript" src="../scripts.js"></script>
|
||||
</head>
|
||||
<body onload="init('sample');">
|
||||
<div style="margin-left: 0px;">
|
||||
The <b>BOOST_PP_FOR</b> macro represents a generalized horizontal repetition construct.
|
||||
</div>
|
||||
<h4>Usage</h4>
|
||||
<div class="code">
|
||||
<b>BOOST_PP_FOR</b>(<i>state</i>, <i>pred</i>, <i>op</i>, <i>macro</i>)
|
||||
</div>
|
||||
<h4>Arguments</h4>
|
||||
<dl>
|
||||
<dt>state</dt>
|
||||
<dd>
|
||||
The initial state.
|
||||
</dd>
|
||||
<dt>pred</dt>
|
||||
<dd>
|
||||
A binary predicate of the form <i>pred</i>(<i>r</i>, <i>state</i>).
|
||||
This macro must expand to an integer in the range of <i>0</i> to <b>BOOST_PP_LIMIT_MAG</b>.
|
||||
<b>BOOST_PP_FOR</b> repeatedly expands <i>macro</i> while this predicate returns non-zero.
|
||||
This macro is called with the next available <b>BOOST_PP_FOR</b> repetition and the current <i>state</i>.
|
||||
</dd>
|
||||
<dt>op</dt>
|
||||
<dd>
|
||||
A binary operation of the form <i>op</i>(<i>r</i>, <i>state</i>).
|
||||
This operation is expanded by <b>BOOST_PP_FOR</b> with the next available <b>BOOST_PP_FOR</b> repetition and the current <i>state</i>.
|
||||
This macro is repeatedly applied to the <i>state</i>, each time producing a new <i>state</i>, until <i>pred</i> returns <i>0</i>.
|
||||
</dd>
|
||||
<dt>macro</dt>
|
||||
<dd>
|
||||
A binary macro of the form <i>macro</i>(<i>r</i>, <i>state</i>).
|
||||
This macro is expanded by <b>BOOST_PP_FOR</b> with the next available <b>BOOST_PP_FOR</b> repetition and the current <i>state</i>.
|
||||
This macro is is repeated by <b>BOOST_PP_FOR</b> until <i>pred</i> returns <i>0</i>.
|
||||
</dd>
|
||||
</dl>
|
||||
<h4>Remarks</h4>
|
||||
<div>
|
||||
This macro expands to the sequence:
|
||||
<div>
|
||||
<i>macro</i>(<i>r</i>, <i>state</i>) <i>macro</i>(<i>r</i>, <i>op</i>(<i>r</i>, <i>state</i>)) ... <i>macro</i>(<i>r</i>, <i>op</i>(<i>r</i>, ... <i>op</i>(<i>r</i>, <i>state</i>) ... ))
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
The <i>r</i> value that is passed to <i>pred</i>, <i>op</i>, and <i>macro</i> represents the next available <b>BOOST_PP_FOR</b> repetition.
|
||||
Other macros that have <b>_R</b> suffix variants internally use <b>BOOST_PP_FOR</b>--for example, <b>BOOST_PP_LIST_FOR_EACH</b> and <b>BOOST_PP_LIST_FOR_EACH_R</b>.
|
||||
Using these <b>_R</b> versions is not strictly necessary, but passing the <i>r</i> value (that is passed to <i>pred</i>, <i>op</i>, and <i>macro</i>) to these macros allows them to reenter <b>BOOST_PP_FOR</b> with maximum efficiency.
|
||||
</div>
|
||||
<div>
|
||||
To directly use this <i>r</i> value, rather than simply passing it to another macro, see <b>BOOST_PP_FOR_<i>r</i></b>.
|
||||
</div>
|
||||
<div>
|
||||
Previously, this macro could not be used recursively inside <b>BOOST_PP_FOR</b>.
|
||||
This limitation no longer exists, as the library can automatically detect the next available <b>BOOST_PP_FOR</b> repetition.
|
||||
</div>
|
||||
<h4>See Also</h4>
|
||||
<ul>
|
||||
<li><a href="for_r.html">BOOST_PP_FOR_<i>r</i></a></li>
|
||||
<li><a href="limit_mag.html">BOOST_PP_LIMIT_MAG</a></li>
|
||||
</ul>
|
||||
<h4>Requirements</h4>
|
||||
<div>
|
||||
<b>Header:</b> <a href="../headers/repetition/for.hpp.html"><boost/preprocessor/repetition/for.hpp></a>
|
||||
</div>
|
||||
<h4><a class="local" onclick="toggle('sample');" onmouseover="change(this);" onmouseout="revert(this);">Sample Code</a></h4>
|
||||
<div id="sample"><pre>
|
||||
#include <boost/preprocessor/arithmetic/inc.hpp>
|
||||
#include <boost/preprocessor/comparison/not_equal.hpp>
|
||||
#include <boost/preprocessor/repetition/for.hpp>
|
||||
#include <boost/preprocessor/tuple/elem.hpp>
|
||||
|
||||
#define PRED(r, state) /* ....................... */ \
|
||||
BOOST_PP_NOT_EQUAL( \
|
||||
BOOST_PP_TUPLE_ELEM(2, 0, state), \
|
||||
BOOST_PP_INC(BOOST_PP_TUPLE_ELEM(2, 1, state)) \
|
||||
) \
|
||||
/**/
|
||||
|
||||
#define OP(r, state) /* .......................... */ \
|
||||
( \
|
||||
BOOST_PP_INC(BOOST_PP_TUPLE_ELEM(2, 0, state)), \
|
||||
BOOST_PP_TUPLE_ELEM(2, 1, state) \
|
||||
) \
|
||||
/**/
|
||||
|
||||
#define MACRO(r, state) BOOST_PP_TUPLE_ELEM(2, 0, state)
|
||||
|
||||
BOOST_PP_FOR((5, 10), PRED, OP, MACRO) // expands to 5 6 7 8 9 10
|
||||
<pre></div>
|
||||
</body>
|
||||
</html>
|
145
docs.1/ref/for_r.html
Normal file
145
docs.1/ref/for_r.html
Normal file
@ -0,0 +1,145 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>BOOST_PP_FOR_r</title>
|
||||
<link rel="stylesheet" type="text/css" href="../styles.css">
|
||||
<script language="javascript" type="text/javascript" src="../scripts.js"></script>
|
||||
</head>
|
||||
<body onload="init('sample');">
|
||||
<div style="margin-left: 0px;">
|
||||
The <b>BOOST_PP_FOR_<i>r</i></b> macro represents a reentry into the <b>BOOST_PP_FOR</b> repetition construct.
|
||||
</div>
|
||||
<h4>Usage</h4>
|
||||
<div class="code">
|
||||
<b>BOOST_PP_FOR_</b> ## <i>r</i>(<i>state</i>, <i>pred</i>, <i>op</i>, <i>macro</i>)
|
||||
</div>
|
||||
<h4>Arguments</h4>
|
||||
<dl>
|
||||
<dt>r</dt>
|
||||
<dd>
|
||||
The next available <b>BOOST_PP_FOR</b> repetition.
|
||||
</dd>
|
||||
<dt>state</dt>
|
||||
<dd>
|
||||
The initial state.
|
||||
</dd>
|
||||
<dt>pred</dt>
|
||||
<dd>
|
||||
A binary predicate of the form <i>pred</i>(<i>r</i>, <i>state</i>).
|
||||
This macro must expand to an integer in the range of <i>0</i> to <b>BOOST_PP_LIMIT_MAG</b>.
|
||||
<b>BOOST_PP_FOR</b> repeatedly expands <i>macro</i> while this predicate returns non-zero.
|
||||
This macro is called with the next available <b>BOOST_PP_FOR</b> repetition and the current <i>state</i>.
|
||||
</dd>
|
||||
<dt>op</dt>
|
||||
<dd>
|
||||
A binary operation of the form <i>op</i>(<i>r</i>, <i>state</i>).
|
||||
This operation is expanded by <b>BOOST_PP_FOR</b> with the next available <b>BOOST_PP_FOR</b> repetition and the current <i>state</i>.
|
||||
This macro is repeatedly applied to the <i>state</i>, each time producing a new <i>state</i>, until <i>pred</i> returns <i>0</i>.
|
||||
</dd>
|
||||
<dt>macro</dt>
|
||||
<dd>
|
||||
A binary macro of the form <i>macro</i>(<i>r</i>, <i>state</i>).
|
||||
This macro is expanded by <b>BOOST_PP_FOR</b> with the next available <b>BOOST_PP_FOR</b> repetition and the current <i>state</i>.
|
||||
This macro is is repeated by <b>BOOST_PP_FOR</b> until <i>pred</i> returns <i>0</i>.
|
||||
</dd>
|
||||
</dl>
|
||||
<h4>Remarks</h4>
|
||||
<div>
|
||||
This macro expands to the sequence:
|
||||
<div>
|
||||
<i>macro</i>(<i>r</i>, <i>state</i>) <i>macro</i>(<i>r</i>, <i>op</i>(<i>r</i>, <i>state</i>)) ... <i>macro</i>(<i>r</i>, <i>op</i>(<i>r</i>, ... <i>op</i>(<i>r</i>, <i>state</i>) ... ))
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
At certain times, it may be necessary to perform the concatenation with <b>BOOST_PP_CAT</b> rather than the preprocessor token-pasting operator.
|
||||
This happens when the <i>r</i> value is a macro invocation itself.
|
||||
It needs a delay to allow it to expand.
|
||||
The syntax in such a scenario becomes:
|
||||
<div>
|
||||
<b>BOOST_PP_CAT</b>(<b>BOOST_PP_FOR_</b>, <i>r</i>)(<i>state</i>, <i>pred</i>, <i>op</i>, <i>macro</i>)
|
||||
</div>
|
||||
</div>
|
||||
<h4>See Also</h4>
|
||||
<ul>
|
||||
<li><a href="cat.html">BOOST_PP_CAT</a></li>
|
||||
<li><a href="for.html">BOOST_PP_FOR</a></li>
|
||||
<li><a href="limit_mag.html">BOOST_PP_LIMIT_MAG</a></li>
|
||||
</ul>
|
||||
<h4>Requirements</h4>
|
||||
<div>
|
||||
<b>Header:</b> <a href="../headers/repetition/for.hpp.html"><boost/preprocessor/repetition/for.hpp></a>
|
||||
</div>
|
||||
<h4><a class="local" onclick="toggle('sample');" onmouseover="change(this);" onmouseout="revert(this);">Sample Code</a></h4>
|
||||
<div id="sample"><pre>
|
||||
#include <boost/preprocessor/arithmetic/dec.hpp>
|
||||
#include <boost/preprocessor/arithmetic/inc.hpp>
|
||||
#include <boost/preprocessor/comparison/not_equal.hpp>
|
||||
#include <boost/preprocessor/punctuation/comma_if.hpp>
|
||||
#include <boost/preprocessor/repetition/for.hpp>
|
||||
#include <boost/preprocessor/tuple/elem.hpp>
|
||||
|
||||
#define PRED(r, state) /* ............ */ \
|
||||
BOOST_PP_NOT_EQUAL( \
|
||||
BOOST_PP_TUPLE_ELEM(4, 0, state), \
|
||||
BOOST_PP_INC( \
|
||||
BOOST_PP_TUPLE_ELEM(4, 1, state) \
|
||||
) \
|
||||
) \
|
||||
/**/
|
||||
|
||||
#define OP(r, state) /* .............. */ \
|
||||
( \
|
||||
BOOST_PP_INC( \
|
||||
BOOST_PP_TUPLE_ELEM(4, 0, state) \
|
||||
), \
|
||||
BOOST_PP_TUPLE_ELEM(4, 1, state), \
|
||||
BOOST_PP_TUPLE_ELEM(4, 2, state), \
|
||||
BOOST_PP_INC( \
|
||||
BOOST_PP_TUPLE_ELEM(4, 3, state) \
|
||||
) \
|
||||
) \
|
||||
/**/
|
||||
|
||||
#define MACRO(r, state) /* ....................... */ \
|
||||
BOOST_PP_COMMA_IF( \
|
||||
BOOST_PP_TUPLE_ELEM(4, 3, state) \
|
||||
) template< \
|
||||
BOOST_PP_FOR_ ## r( \
|
||||
(0, BOOST_PP_TUPLE_ELEM(4, 0, state), _, 0), \
|
||||
PRED_2, OP, MACRO_2 \
|
||||
) \
|
||||
> class BOOST_PP_CAT( \
|
||||
BOOST_PP_TUPLE_ELEM(4, 2, state), \
|
||||
BOOST_PP_TUPLE_ELEM(4, 0, state) \
|
||||
) \
|
||||
/**/
|
||||
|
||||
#define PRED_2(r, state) /* ........ */ \
|
||||
BOOST_PP_NOT_EQUAL( \
|
||||
BOOST_PP_TUPLE_ELEM(4, 0, state), \
|
||||
BOOST_PP_TUPLE_ELEM(4, 1, state) \
|
||||
) \
|
||||
/**/
|
||||
|
||||
#define MACRO_2(r, state) /* ...... */ \
|
||||
BOOST_PP_COMMA_IF( \
|
||||
BOOST_PP_TUPLE_ELEM(4, 0, state) \
|
||||
) class \
|
||||
/**/
|
||||
|
||||
#define TEMPLATE_TEMPLATE(low, high, name) /* ... */ \
|
||||
BOOST_PP_FOR( \
|
||||
(low, high, name, 0), \
|
||||
PRED, OP, MACRO \
|
||||
) \
|
||||
/**/
|
||||
|
||||
TEMPLATE_TEMPLATE(2, 4, T)
|
||||
/*
|
||||
expands to...
|
||||
template<class, class> class T2,
|
||||
template<class, class, class> class T3,
|
||||
template<class, class, class, class> class T4
|
||||
*/
|
||||
<pre></div>
|
||||
</body>
|
||||
</html>
|
32
docs.1/ref/frame_finish.html
Normal file
32
docs.1/ref/frame_finish.html
Normal file
@ -0,0 +1,32 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>BOOST_PP_FRAME_FINISH</title>
|
||||
<link rel="stylesheet" type="text/css" href="../styles.css">
|
||||
<script language="javascript" type="text/javascript" src="../scripts.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<div style="margin-left: 0px;">
|
||||
The <b>BOOST_PP_FRAME_FINISH</b> macro expands to the upper bound of an absolute <i>file-iteration</i> depth.
|
||||
</div>
|
||||
<h4>Usage</h4>
|
||||
<div class="code">
|
||||
<b>BOOST_PP_FRAME_FINISH</b>(<i>i</i>)
|
||||
</div>
|
||||
<h4>Arguments</h4>
|
||||
<dl>
|
||||
<dt>i</dt>
|
||||
<dd>
|
||||
The absolute depth of the frame whose upper bound is to be retreived.
|
||||
Valid values range from <i>1</i> to <b>BOOST_PP_ITERATION_DEPTH</b>().
|
||||
</dd>
|
||||
</dl>
|
||||
<h4>Remarks</h4>
|
||||
<div>
|
||||
This macro is only valid when a <i>file-iteration</i> is in progress.
|
||||
</div>
|
||||
<h4>Requirements</h4>
|
||||
<div>
|
||||
<b>Header:</b> <a href="../headers/iteration/iterate.hpp.html"><boost/preprocessor/iteration/iterate.hpp></a>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
32
docs.1/ref/frame_flags.html
Normal file
32
docs.1/ref/frame_flags.html
Normal file
@ -0,0 +1,32 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>BOOST_PP_FRAME_FLAGS</title>
|
||||
<link rel="stylesheet" type="text/css" href="../styles.css">
|
||||
<script language="javascript" type="text/javascript" src="../scripts.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<div style="margin-left: 0px;">
|
||||
The <b>BOOST_PP_FRAME_FLAGS</b> macro expands to the flags associated with an absolute <i>file-iteration</i> depth.
|
||||
</div>
|
||||
<h4>Usage</h4>
|
||||
<div class="code">
|
||||
<b>BOOST_PP_FRAME_FLAGS</b>(<i>i</i>)
|
||||
</div>
|
||||
<h4>Arguments</h4>
|
||||
<dl>
|
||||
<dt>i</dt>
|
||||
<dd>
|
||||
The absolute depth of the frame whose flags are to be retreived.
|
||||
Valid values range from <i>1</i> to <b>BOOST_PP_ITERATION_DEPTH</b>().
|
||||
</dd>
|
||||
</dl>
|
||||
<h4>Remarks</h4>
|
||||
<div>
|
||||
This macro is only valid when a <i>file-iteration</i> is in progress.
|
||||
</div>
|
||||
<h4>Requirements</h4>
|
||||
<div>
|
||||
<b>Header:</b> <a href="../headers/iteration/iterate.hpp.html"><boost/preprocessor/iteration/iterate.hpp></a>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
63
docs.1/ref/frame_iteration.html
Normal file
63
docs.1/ref/frame_iteration.html
Normal file
@ -0,0 +1,63 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>BOOST_PP_FRAME_ITERATION</title>
|
||||
<link rel="stylesheet" type="text/css" href="../styles.css">
|
||||
<script language="javascript" type="text/javascript" src="../scripts.js"></script>
|
||||
</head>
|
||||
<body onload="init('sample');">
|
||||
<div style="margin-left: 0px;">
|
||||
The <b>BOOST_PP_FRAME_ITERATION</b> macro expands to the iteration value of an absolute <i>file-iteration</i> depth.
|
||||
</div>
|
||||
<h4>Usage</h4>
|
||||
<div class="code">
|
||||
<b>BOOST_PP_FRAME_ITERATION</b>(<i>i</i>)
|
||||
</div>
|
||||
<h4>Arguments</h4>
|
||||
<dl>
|
||||
<dt>i</dt>
|
||||
<dd>
|
||||
The absolute depth of the frame whose iteration value is to be retreived.
|
||||
Valid values range from <i>1</i> to <b>BOOST_PP_ITERATION_DEPTH</b>().
|
||||
</dd>
|
||||
</dl>
|
||||
<h4>Remarks</h4>
|
||||
<div>
|
||||
This macro is only valid when a <i>file-iteration</i> is in progress.
|
||||
</div>
|
||||
<h4>Requirements</h4>
|
||||
<div>
|
||||
<b>Header:</b> <a href="../headers/iteration/iterate.hpp.html"><boost/preprocessor/iteration/iterate.hpp></a>
|
||||
</div>
|
||||
<h4><a class="local" onclick="toggle('sample');" onmouseover="change(this);" onmouseout="revert(this);">Sample Code</a></h4>
|
||||
<div id="sample"><pre>
|
||||
// file.h
|
||||
#if !BOOST_PP_IS_ITERATING
|
||||
|
||||
#ifndef FILE_H_
|
||||
#define FILE_H_
|
||||
|
||||
#include <boost/preprocessor/iteration/iterate.hpp>
|
||||
|
||||
#define BOOST_PP_ITERATION_PARAMS_1 (3, (1, 10, "file.h"))
|
||||
#include BOOST_PP_ITERATE()
|
||||
|
||||
#endif
|
||||
|
||||
#elif BOOST_PP_ITERATION_DEPTH() == 1
|
||||
|
||||
--
|
||||
#define BOOST_PP_ITERATION_PARAMS_2 /* ... */ \
|
||||
(3, (1, BOOST_PP_ITERATION(), "file.h")) \
|
||||
/**/
|
||||
|
||||
#include BOOST_PP_ITERATE()
|
||||
|
||||
#else
|
||||
|
||||
outer: BOOST_PP_FRAME_ITERATION(1)
|
||||
inner: BOOST_PP_FRAME_ITERATION(2)
|
||||
|
||||
#endif
|
||||
<pre></div>
|
||||
</body>
|
||||
</html>
|
32
docs.1/ref/frame_start.html
Normal file
32
docs.1/ref/frame_start.html
Normal file
@ -0,0 +1,32 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>BOOST_PP_FRAME_START</title>
|
||||
<link rel="stylesheet" type="text/css" href="../styles.css">
|
||||
<script language="javascript" type="text/javascript" src="../scripts.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<div style="margin-left: 0px;">
|
||||
The <b>BOOST_PP_FRAME_START</b> macro expands to the lower bound of an absolute <i>file-iteration</i> depth.
|
||||
</div>
|
||||
<h4>Usage</h4>
|
||||
<div class="code">
|
||||
<b>BOOST_PP_FRAME_START</b>(<i>i</i>)
|
||||
</div>
|
||||
<h4>Arguments</h4>
|
||||
<dl>
|
||||
<dt>i</dt>
|
||||
<dd>
|
||||
The absolute depth of the frame whose lower bound is to be retreived.
|
||||
Valid values range from <i>1</i> to <b>BOOST_PP_ITERATION_DEPTH</b>().
|
||||
</dd>
|
||||
</dl>
|
||||
<h4>Remarks</h4>
|
||||
<div>
|
||||
This macro is only valid when a <i>file-iteration</i> is in progress.
|
||||
</div>
|
||||
<h4>Requirements</h4>
|
||||
<div>
|
||||
<b>Header:</b> <a href="../headers/iteration/iterate.hpp.html"><boost/preprocessor/iteration/iterate.hpp></a>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
55
docs.1/ref/greater.html
Normal file
55
docs.1/ref/greater.html
Normal file
@ -0,0 +1,55 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>BOOST_PP_GREATER</title>
|
||||
<link rel="stylesheet" type="text/css" href="../styles.css">
|
||||
<script language="javascript" type="text/javascript" src="../scripts.js"></script>
|
||||
</head>
|
||||
<body onload="init('sample');">
|
||||
<div style="margin-left: 0px;">
|
||||
The <b>BOOST_PP_GREATER</b> macro compares two values for greater magnitude.
|
||||
</div>
|
||||
<h4>Usage</h4>
|
||||
<div class="code">
|
||||
<b>BOOST_PP_GREATER</b>(<i>x</i>, <i>y</i>)
|
||||
</div>
|
||||
<h4>Arguments</h4>
|
||||
<dl>
|
||||
<dt>x</dt>
|
||||
<dd>
|
||||
The left operand of the comparison.
|
||||
Valid values range from <i>0</i> to <b>BOOST_PP_LIMIT_MAG</b>.
|
||||
</dd>
|
||||
<dt>y</dt>
|
||||
<dd>
|
||||
The right operand of the comparison.
|
||||
Valid values range from <i>0</i> to <b>BOOST_PP_LIMIT_MAG</b>.
|
||||
</dd>
|
||||
</dl>
|
||||
<h4>Remarks</h4>
|
||||
<div>
|
||||
If <i>x</i> is greater than <i>y</i>, this macro expands to <i>1</i>.
|
||||
Otherwise, it expands to <i>0</i>.
|
||||
</div>
|
||||
<div>
|
||||
Previously, this macro could not be used inside <b>BOOST_PP_WHILE</b>.
|
||||
There is no longer any such restriction.
|
||||
It is more efficient, however, to use <b>BOOST_PP_GREATER_D</b> in such a situation.
|
||||
</div>
|
||||
<h4>See Also</h4>
|
||||
<ul>
|
||||
<li><a href="greater_d.html">BOOST_PP_GREATER_D</a></li>
|
||||
<li><a href="limit_mag.html">BOOST_PP_LIMIT_MAG</a></li>
|
||||
</ul>
|
||||
<h4>Requirements</h4>
|
||||
<div>
|
||||
<b>Header:</b> <a href="../headers/comparison/greater.hpp.html"><boost/preprocessor/comparison/greater.hpp></a>
|
||||
</div>
|
||||
<h4><a class="local" onclick="toggle('sample');" onmouseover="change(this);" onmouseout="revert(this);">Sample Code</a></h4>
|
||||
<div id="sample"><pre>
|
||||
#include <boost/preprocessor/comparison/greater.hpp>
|
||||
|
||||
BOOST_PP_GREATER(4, 3) // expands to 1
|
||||
BOOST_PP_GREATER(5, 5) // expands to 0
|
||||
<pre></div>
|
||||
</body>
|
||||
</html>
|
59
docs.1/ref/greater_d.html
Normal file
59
docs.1/ref/greater_d.html
Normal file
@ -0,0 +1,59 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>BOOST_PP_GREATER_D</title>
|
||||
<link rel="stylesheet" type="text/css" href="../styles.css">
|
||||
<script language="javascript" type="text/javascript" src="../scripts.js"></script>
|
||||
</head>
|
||||
<body onload="init('sample');">
|
||||
<div style="margin-left: 0px;">
|
||||
The <b>BOOST_PP_GREATER_D</b> macro compares two values for greater magnitude.
|
||||
It reenters <b>BOOST_PP_WHILE</b> with maximum efficiency.
|
||||
</div>
|
||||
<h4>Usage</h4>
|
||||
<div class="code">
|
||||
<b>BOOST_PP_GREATER_D</b>(<i>d</i>, <i>x</i>, <i>y</i>)
|
||||
</div>
|
||||
<h4>Arguments</h4>
|
||||
<dl>
|
||||
<dt>d</dt>
|
||||
<dd>
|
||||
The next available <b>BOOST_PP_WHILE</b> iteration.
|
||||
</dd>
|
||||
<dt>x</dt>
|
||||
<dd>
|
||||
The left operand of the comparison.
|
||||
Valid values range from <i>0</i> to <b>BOOST_PP_LIMIT_MAG</b>.
|
||||
</dd>
|
||||
<dt>y</dt>
|
||||
<dd>
|
||||
The right operand of the comparison.
|
||||
Valid values range from <i>0</i> to <b>BOOST_PP_LIMIT_MAG</b>.
|
||||
</dd>
|
||||
</dl>
|
||||
<h4>Remarks</h4>
|
||||
<div>
|
||||
If <i>x</i> is greater than <i>y</i>, this macro expands to <i>1</i>.
|
||||
Otherwise, it expands to <i>0</i>.
|
||||
</div>
|
||||
<h4>See Also</h4>
|
||||
<ul>
|
||||
<li><a href="greater.html">BOOST_PP_GREATER</a></li>
|
||||
<li><a href="limit_mag.html">BOOST_PP_LIMIT_MAG</a></li>
|
||||
</ul>
|
||||
<h4>Requirements</h4>
|
||||
<div>
|
||||
<b>Header:</b> <a href="../headers/comparison/greater.hpp.html"><boost/preprocessor/comparison/greater.hpp></a>
|
||||
</div>
|
||||
<h4><a class="local" onclick="toggle('sample');" onmouseover="change(this);" onmouseout="revert(this);">Sample Code</a></h4>
|
||||
<div id="sample"><pre>
|
||||
#include <boost/preprocessor/comparison/greater.hpp>
|
||||
#include <boost/preprocessor/list/filter.hpp>
|
||||
|
||||
#define LIST (1, (2, (3, (4, (5, BOOST_PP_NIL)))))
|
||||
|
||||
#define PRED(d, _, num) BOOST_PP_GREATER_D(d, num, 2)
|
||||
|
||||
BOOST_PP_LIST_FILTER(PRED, nil, LIST) // expands to (3, (4, (5, BOOST_PP_NIL)))
|
||||
<pre></div>
|
||||
</body>
|
||||
</html>
|
55
docs.1/ref/greater_equal.html
Normal file
55
docs.1/ref/greater_equal.html
Normal file
@ -0,0 +1,55 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>BOOST_PP_GREATER_EQUAL</title>
|
||||
<link rel="stylesheet" type="text/css" href="../styles.css">
|
||||
<script language="javascript" type="text/javascript" src="../scripts.js"></script>
|
||||
</head>
|
||||
<body onload="init('sample');">
|
||||
<div style="margin-left: 0px;">
|
||||
The <b>BOOST_PP_GREATER_EQUAL</b> macro compares two values for equality or greater magnitude.
|
||||
</div>
|
||||
<h4>Usage</h4>
|
||||
<div class="code">
|
||||
<b>BOOST_PP_GREATER_EQUAL</b>(<i>x</i>, <i>y</i>)
|
||||
</div>
|
||||
<h4>Arguments</h4>
|
||||
<dl>
|
||||
<dt>x</dt>
|
||||
<dd>
|
||||
The left operand of the comparison.
|
||||
Valid values range from <i>0</i> to <b>BOOST_PP_LIMIT_MAG</b>.
|
||||
</dd>
|
||||
<dt>y</dt>
|
||||
<dd>
|
||||
The right operand of the comparison.
|
||||
Valid values range from <i>0</i> to <b>BOOST_PP_LIMIT_MAG</b>.
|
||||
</dd>
|
||||
</dl>
|
||||
<h4>Remarks</h4>
|
||||
<div>
|
||||
If <i>x</i> is greater than or equal to <i>y</i>, this macro expands to <i>1</i>.
|
||||
Otherwise, it expands to <i>0</i>.
|
||||
</div>
|
||||
<div>
|
||||
Previously, this macro could not be used inside <b>BOOST_PP_WHILE</b>.
|
||||
There is no longer any such restriction.
|
||||
It is more efficient, however, to use <b>BOOST_PP_GREATER_EQUAL_D</b> in such a situation.
|
||||
</div>
|
||||
<h4>See Also</h4>
|
||||
<ul>
|
||||
<li><a href="greater_equal_d.html">BOOST_PP_GREATER_EQUAL_D</a></li>
|
||||
<li><a href="limit_mag.html">BOOST_PP_LIMIT_MAG</a></li>
|
||||
</ul>
|
||||
<h4>Requirements</h4>
|
||||
<div>
|
||||
<b>Header:</b> <a href="../headers/comparison/greater_equal.hpp.html"><boost/preprocessor/comparison/greater_equal.hpp></a>
|
||||
</div>
|
||||
<h4><a class="local" onclick="toggle('sample');" onmouseover="change(this);" onmouseout="revert(this);">Sample Code</a></h4>
|
||||
<div id="sample"><pre>
|
||||
#include <boost/preprocessor/comparison/greater_equal.hpp>
|
||||
|
||||
BOOST_PP_GREATER_EQUAL(4, 3) // expands to 1
|
||||
BOOST_PP_GREATER_EQUAL(5, 5) // expands to 1
|
||||
<pre></div>
|
||||
</body>
|
||||
</html>
|
59
docs.1/ref/greater_equal_d.html
Normal file
59
docs.1/ref/greater_equal_d.html
Normal file
@ -0,0 +1,59 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>BOOST_PP_GREATER_EQUAL_D</title>
|
||||
<link rel="stylesheet" type="text/css" href="../styles.css">
|
||||
<script language="javascript" type="text/javascript" src="../scripts.js"></script>
|
||||
</head>
|
||||
<body onload="init('sample');">
|
||||
<div style="margin-left: 0px;">
|
||||
The <b>BOOST_PP_GREATER_EQUAL_D</b> macro compares two values for equality or greater magnitude.
|
||||
It reenters <b>BOOST_PP_WHILE</b> with maximum efficiency.
|
||||
</div>
|
||||
<h4>Usage</h4>
|
||||
<div class="code">
|
||||
<b>BOOST_PP_GREATER_EQUAL_D</b>(<i>d</i>, <i>x</i>, <i>y</i>)
|
||||
</div>
|
||||
<h4>Arguments</h4>
|
||||
<dl>
|
||||
<dt>d</dt>
|
||||
<dd>
|
||||
The next available <b>BOOST_PP_WHILE</b> iteration.
|
||||
</dd>
|
||||
<dt>x</dt>
|
||||
<dd>
|
||||
The left operand of the comparison.
|
||||
Valid values range from <i>0</i> to <b>BOOST_PP_LIMIT_MAG</b>.
|
||||
</dd>
|
||||
<dt>y</dt>
|
||||
<dd>
|
||||
The right operand of the comparison.
|
||||
Valid values range from <i>0</i> to <b>BOOST_PP_LIMIT_MAG</b>.
|
||||
</dd>
|
||||
</dl>
|
||||
<h4>Remarks</h4>
|
||||
<div>
|
||||
If <i>x</i> is greater than or equal to <i>y</i>, this macro expands to <i>1</i>.
|
||||
Otherwise, it expands to <i>0</i>.
|
||||
</div>
|
||||
<h4>See Also</h4>
|
||||
<ul>
|
||||
<li><a href="greater_equal.html">BOOST_PP_GREATER_EQUAL</a></li>
|
||||
<li><a href="limit_mag.html">BOOST_PP_LIMIT_MAG</a></li>
|
||||
</ul>
|
||||
<h4>Requirements</h4>
|
||||
<div>
|
||||
<b>Header:</b> <a href="../headers/comparison/greater_equal.hpp.html"><boost/preprocessor/comparison/greater_equal.hpp></a>
|
||||
</div>
|
||||
<h4><a class="local" onclick="toggle('sample');" onmouseover="change(this);" onmouseout="revert(this);">Sample Code</a></h4>
|
||||
<div id="sample"><pre>
|
||||
#include <boost/preprocessor/comparison/greater_equal.hpp>
|
||||
#include <boost/preprocessor/list/filter.hpp>
|
||||
|
||||
#define LIST (1, (2, (3, (4, (5, BOOST_PP_NIL)))))
|
||||
|
||||
#define PRED(d, _, num) BOOST_PP_GREATER_EQUAL_D(d, num, 4)
|
||||
|
||||
BOOST_PP_LIST_FILTER(PRED, nil, LIST) // expands to (4, (5, BOOST_PP_NIL))
|
||||
<pre></div>
|
||||
</body>
|
||||
</html>
|
47
docs.1/ref/identity.html
Normal file
47
docs.1/ref/identity.html
Normal file
@ -0,0 +1,47 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>BOOST_PP_IDENTITY</title>
|
||||
<link rel="stylesheet" type="text/css" href="../styles.css">
|
||||
<script language="javascript" type="text/javascript" src="../scripts.js"></script>
|
||||
</head>
|
||||
<body onload="init('sample');">
|
||||
<div style="margin-left: 0px;">
|
||||
The <b>BOOST_PP_IDENTITY</b> macro expands to its argument when invoked.
|
||||
</div>
|
||||
<h4>Usage</h4>
|
||||
<div class="code">
|
||||
<b>BOOST_PP_IDENTITY</b>(<i>item</i>)()
|
||||
</div>
|
||||
<h4>Arguments</h4>
|
||||
<dl>
|
||||
<dt>item</dt>
|
||||
<dd>
|
||||
The result of the expansion.
|
||||
</dd>
|
||||
</dl>
|
||||
<h4>Remarks</h4>
|
||||
<div>
|
||||
This macro is designed to be used with <b>BOOST_PP_IF</b> and <b>BOOST_PP_IIF</b> when only one of the clauses needs to be invoked.
|
||||
</div>
|
||||
<h4>See Also</h4>
|
||||
<ul>
|
||||
<li><a href="if.html">BOOST_PP_IF</a></li>
|
||||
<li><a href="iif.html">BOOST_PP_IIF</a></li>
|
||||
</ul>
|
||||
<h4>Requirements</h4>
|
||||
<div>
|
||||
<b>Header:</b> <a href="../headers/facilities/identity.hpp.html"><boost/preprocessor/facilities/identity.hpp></a>
|
||||
</div>
|
||||
<h4><a class="local" onclick="toggle('sample');" onmouseover="change(this);" onmouseout="revert(this);">Sample Code</a></h4>
|
||||
<div id="sample"><pre>
|
||||
#include <boost/preprocessor/control/if.hpp>
|
||||
#include <boost/preprocessor/facilities/empty.hpp>
|
||||
#include <boost/preprocessor/facilities/identity.hpp>
|
||||
|
||||
#define MACRO(n) BOOST_PP_IF(n, BOOST_PP_IDENTITY(x), BOOST_PP_EMPTY)()
|
||||
|
||||
MACRO(0) // expands to nothing
|
||||
MACRO(1) // expands to x
|
||||
<pre></div>
|
||||
</body>
|
||||
</html>
|
53
docs.1/ref/if.html
Normal file
53
docs.1/ref/if.html
Normal file
@ -0,0 +1,53 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>BOOST_PP_IF</title>
|
||||
<link rel="stylesheet" type="text/css" href="../styles.css">
|
||||
<script language="javascript" type="text/javascript" src="../scripts.js"></script>
|
||||
</head>
|
||||
<body onload="init('sample');">
|
||||
<div style="margin-left: 0px;">
|
||||
The <b>BOOST_PP_IF</b> macro chooses between to values based on a logical condition.
|
||||
</div>
|
||||
<h4>Usage</h4>
|
||||
<div class="code">
|
||||
<b>BOOST_PP_IF</b>(<i>cond</i>, <i>t</i>, <i>f</i>)
|
||||
</div>
|
||||
<h4>Arguments</h4>
|
||||
<dl>
|
||||
<dt>cond</dt>
|
||||
<dd>
|
||||
The condition that determines if the result is <i>expr</i> or nothing.
|
||||
Valid values range from <i>0</i> to <b>BOOST_PP_LIMIT_MAG</b>.
|
||||
</dd>
|
||||
<dt>t</dt>
|
||||
<dd>
|
||||
The result of the expansion if <i>cond</i> is non-zero.
|
||||
</dd>
|
||||
<dt>f</dt>
|
||||
<dd>
|
||||
The result of the expansion if <i>cond</i> is <i>0</i>.
|
||||
</dd>
|
||||
</dl>
|
||||
<h4>Remarks</h4>
|
||||
<div>
|
||||
This macro performs a boolean conversion on its first argument.
|
||||
If that conversion is unnecessary, use <b>BOOST_PP_IIF</b> instead.
|
||||
</div>
|
||||
<h4>See Also</h4>
|
||||
<ul>
|
||||
<li><a href="iif.html">BOOST_PP_IIF</a></li>
|
||||
<li><a href="limit_mag.html">BOOST_PP_LIMIT_MAG</a></li>
|
||||
</ul>
|
||||
<h4>Requirements</h4>
|
||||
<div>
|
||||
<b>Header:</b> <a href="../headers/control/if.hpp.html"><boost/preprocessor/control/if.hpp></a>
|
||||
</div>
|
||||
<h4><a class="local" onclick="toggle('sample');" onmouseover="change(this);" onmouseout="revert(this);">Sample Code</a></h4>
|
||||
<div id="sample"><pre>
|
||||
#include <boost/preprocessor/control/if.hpp>
|
||||
|
||||
BOOST_PP_IF(10, a, b) // expands to a
|
||||
BOOST_PP_IF(0, a, b) // expands to b
|
||||
<pre></div>
|
||||
</body>
|
||||
</html>
|
55
docs.1/ref/iif.html
Normal file
55
docs.1/ref/iif.html
Normal file
@ -0,0 +1,55 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>BOOST_PP_IIF</title>
|
||||
<link rel="stylesheet" type="text/css" href="../styles.css">
|
||||
<script language="javascript" type="text/javascript" src="../scripts.js"></script>
|
||||
</head>
|
||||
<body onload="init('sample');">
|
||||
<div style="margin-left: 0px;">
|
||||
The <b>BOOST_PP_IIF</b> macro chooses between to values based on a bitwise condition.
|
||||
</div>
|
||||
<h4>Usage</h4>
|
||||
<div class="code">
|
||||
<b>BOOST_PP_IIF</b>(<i>bit</i>, <i>t</i>, <i>f</i>)
|
||||
</div>
|
||||
<h4>Arguments</h4>
|
||||
<dl>
|
||||
<dt>bit</dt>
|
||||
<dd>
|
||||
The condition that determines if the result is <i>expr</i> or nothing.
|
||||
This value must expand to <i>0</i> or <i>1</i>.
|
||||
</dd>
|
||||
<dt>t</dt>
|
||||
<dd>
|
||||
The result of the expansion if <i>bit</i> is <i>1</i>.
|
||||
</dd>
|
||||
<dt>f</dt>
|
||||
<dd>
|
||||
The result of the expansion if <i>bit</i> is <i>0</i>.
|
||||
</dd>
|
||||
</dl>
|
||||
<h4>Remarks</h4>
|
||||
<div>
|
||||
This macro <i>does not</i> perform a boolean conversion on its first argument.
|
||||
If that conversion is necessary, use <b>BOOST_PP_IF</b> instead.
|
||||
</div>
|
||||
<h4>See Also</h4>
|
||||
<ul>
|
||||
<li><a href="if.html">BOOST_PP_IF</a></li>
|
||||
<li><a href="limit_mag.html">BOOST_PP_LIMIT_MAG</a></li>
|
||||
</ul>
|
||||
<h4>Requirements</h4>
|
||||
<div>
|
||||
<b>Header:</b> <a href="../headers/control/iif.hpp.html"><boost/preprocessor/control/iif.hpp></a>
|
||||
</div>
|
||||
<h4><a class="local" onclick="toggle('sample');" onmouseover="change(this);" onmouseout="revert(this);">Sample Code</a></h4>
|
||||
<div id="sample"><pre>
|
||||
#include <boost/preprocessor/control/iif.hpp>
|
||||
|
||||
#define OR_IF(p, q, t, f) BOOST_PP_IIF(BOOST_PP_OR(p, q), t, f)
|
||||
|
||||
OR_IF(1, 0, abc, xyz) // expands to abc
|
||||
OF_IF(0, 0, abc, xyz) // expands to xyz
|
||||
<pre></div>
|
||||
</body>
|
||||
</html>
|
44
docs.1/ref/inc.html
Normal file
44
docs.1/ref/inc.html
Normal file
@ -0,0 +1,44 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>BOOST_PP_INC</title>
|
||||
<link rel="stylesheet" type="text/css" href="../styles.css">
|
||||
<script language="javascript" type="text/javascript" src="../scripts.js"></script>
|
||||
</head>
|
||||
<body onload="init('sample');">
|
||||
<div style="margin-left: 0px;">
|
||||
The <b>BOOST_PP_INC</b> macro expands to one more than its argument.
|
||||
</div>
|
||||
<h4>Usage</h4>
|
||||
<div class="code">
|
||||
<b>BOOST_PP_INC</b>(<i>x</i>)
|
||||
</div>
|
||||
<h4>Arguments</h4>
|
||||
<dl>
|
||||
<dt>x</dt>
|
||||
<dd>
|
||||
The value to be incremented.
|
||||
Valid values range from <i>0</i> to <b>BOOST_PP_LIMIT_MAG</b>.
|
||||
</dd>
|
||||
</dl>
|
||||
<h4>Remarks</h4>
|
||||
<div>
|
||||
If <i>x</i> is <b>BOOST_PP_LIMIT_MAG</b>, the result is saturated to <b>BOOST_PP_LIMIT_MAG</b>.
|
||||
</div>
|
||||
<h4>See Also</h4>
|
||||
<ul>
|
||||
<li><a href="dec.html">BOOST_PP_DEC</a></li>
|
||||
<li><a href="limit_mag.html">BOOST_PP_LIMIT_MAG</a></li>
|
||||
</ul>
|
||||
<h4>Requirements</h4>
|
||||
<div>
|
||||
<b>Header:</b> <a href="../headers/arithmetic/inc.hpp.html"><boost/preprocessor/arithmetic/inc.hpp></a>
|
||||
</div>
|
||||
<h4><a class="local" onclick="toggle('sample');" onmouseover="change(this);" onmouseout="revert(this);">Sample Code</a></h4>
|
||||
<div id="sample"><pre>
|
||||
#include <boost/preprocessor/arithmetic/inc.hpp>
|
||||
|
||||
BOOST_PP_INC(BOOST_PP_INC(6)) // expands to 8
|
||||
BOOST_PP_INC(4) // expands to 5
|
||||
<pre></div>
|
||||
</body>
|
||||
</html>
|
91
docs.1/ref/include_self.html
Normal file
91
docs.1/ref/include_self.html
Normal file
@ -0,0 +1,91 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>BOOST_PP_INCLUDE_SELF</title>
|
||||
<link rel="stylesheet" type="text/css" href="../styles.css">
|
||||
<script language="javascript" type="text/javascript" src="../scripts.js"></script>
|
||||
</head>
|
||||
<body onload="init('sample');">
|
||||
<div style="margin-left: 0px;">
|
||||
The <b>BOOST_PP_INCLUDE_SELF</b> macro includes a file indirectly.
|
||||
</div>
|
||||
<h4>Usage</h4>
|
||||
<div class="code">
|
||||
#include <b>BOOST_PP_INCLUDE_SELF</b>()
|
||||
</div>
|
||||
<h4>Arguments</h4>
|
||||
<dl>
|
||||
<dt>filename</dt>
|
||||
<dd>
|
||||
A quoted or angle-bracketed filename to be included by <b>BOOST_PP_INCLUDE_SELF</b>.
|
||||
</dd>
|
||||
</dl>
|
||||
<h4>Remarks</h4>
|
||||
<div>
|
||||
<b>BOOST_PP_INDIRECT_SELF</b> must be defined prior to using this macro.
|
||||
</div>
|
||||
<div>
|
||||
Most preprocessors will not allow a file to directly include itself--even when the file protects itself from such a scenario.
|
||||
This macro, in combination with <b>BOOST_PP_INDIRECT_SELF</b> allows a file to include itself indirectly.
|
||||
</div>
|
||||
<div>
|
||||
While <b>BOOST_PP_INDIRECT_SELF</b> is being included, <b>BOOST_PP_INCLUDE_SELF</b> defines the macro <b>BOOST_PP_IS_SELFISH</b> to <i>1</i>.
|
||||
When it returns from the inclusion, <b>BOOST_PP_IS_SELFISH</b> is undefined.
|
||||
</div>
|
||||
<h4>See Also</h4>
|
||||
<ul>
|
||||
<li><a href="indirect_self.html">BOOST_PP_INDIRECT_SELF</a></li>
|
||||
<li><a href="is_selfish.html">BOOST_PP_IS_SELFISH</a></li>
|
||||
</ul>
|
||||
<h4>Requirements</h4>
|
||||
<div>
|
||||
<b>Header:</b> <a href="../headers/iteration/self.hpp.html"><boost/preprocessor/iteration/self.hpp></a>
|
||||
</div>
|
||||
<h4><a class="local" onclick="toggle('sample');" onmouseover="change(this);" onmouseout="revert(this);">Sample Code</a></h4>
|
||||
<div id="sample"><pre>
|
||||
// file.h
|
||||
#if !BOOST_PP_IS_SELFISH
|
||||
|
||||
#ifndef FILE_H_
|
||||
#define FILE_H_
|
||||
|
||||
#include <boost/preprocessor/iteration/self.hpp>
|
||||
|
||||
#define NAME X
|
||||
struct NAME {
|
||||
// ...
|
||||
#define BOOST_PP_INDIRECT_SELF "file.h"
|
||||
#include BOOST_PP_INCLUDE_SELF()
|
||||
};
|
||||
|
||||
#define NAME Y
|
||||
struct NAME {
|
||||
// ...
|
||||
#define BOOST_PP_INDIRECT_SELF "file.h"
|
||||
#include BOOST_PP_INCLUDE_SELF()
|
||||
};
|
||||
|
||||
#define NAME Z
|
||||
struct NAME {
|
||||
// ...
|
||||
#define BOOST_PP_INDIRECT_SELF "file.h"
|
||||
#include BOOST_PP_INCLUDE_SELF()
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
#else
|
||||
|
||||
inline bool validate(NAME* p) {
|
||||
return true;
|
||||
}
|
||||
|
||||
template<class T> bool validate(T* p) {
|
||||
return dynamic_cast<NAME*>(p);
|
||||
}
|
||||
|
||||
#undef NAME
|
||||
|
||||
#endif
|
||||
<pre></div>
|
||||
</body>
|
||||
</html>
|
35
docs.1/ref/indirect_self.html
Normal file
35
docs.1/ref/indirect_self.html
Normal file
@ -0,0 +1,35 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>BOOST_PP_INDIRECT_SELF</title>
|
||||
<link rel="stylesheet" type="text/css" href="../styles.css">
|
||||
<script language="javascript" type="text/javascript" src="../scripts.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<div style="margin-left: 0px;">
|
||||
The <b>BOOST_PP_INDIRECT_SELF</b> macro is a user-defined <i>named external argument</i> used by <b>BOOST_PP_INCLUDE_SELF</b>.
|
||||
</div>
|
||||
<h4>Usage</h4>
|
||||
<div class="code">
|
||||
#define <b>BOOST_PP_INDIRECT_SELF</b> <i>filename</i>
|
||||
</div>
|
||||
<h4>Arguments</h4>
|
||||
<dl>
|
||||
<dt>filename</dt>
|
||||
<dd>
|
||||
A quoted or angle-bracketed filename to be included by <b>BOOST_PP_INCLUDE_SELF</b>.
|
||||
</dd>
|
||||
</dl>
|
||||
<h4>Remarks</h4>
|
||||
<div>
|
||||
Most preprocessors will not allow a file to directly include itself--even when the file protects itself from such a scenario.
|
||||
This macro, in combination with <b>BOOST_PP_INCLUDE_SELF</b> allows a file to include itself indirectly.
|
||||
</div>
|
||||
<div>
|
||||
This macro is automatically undefined for reuse by a call to <b>BOOST_PP_INCLUDE_SELF</b>.
|
||||
</div>
|
||||
<h4>See Also</h4>
|
||||
<ul>
|
||||
<li><a href="include_self.html">BOOST_PP_INCLUDE_SELF</a></li>
|
||||
</ul>
|
||||
</body>
|
||||
</html>
|
41
docs.1/ref/intercept.html
Normal file
41
docs.1/ref/intercept.html
Normal file
@ -0,0 +1,41 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>BOOST_PP_INTERCEPT</title>
|
||||
<link rel="stylesheet" type="text/css" href="../styles.css">
|
||||
<script language="javascript" type="text/javascript" src="../scripts.js"></script>
|
||||
</head>
|
||||
<body onload="init('sample');">
|
||||
<div style="margin-left: 0px;">
|
||||
The <b>BOOST_PP_INTERCEPT</b> macro intercepts a numeric concatenation and expands to nothing.
|
||||
</div>
|
||||
<h4>Usage</h4>
|
||||
<div class="code">
|
||||
<b>BOOST_PP_INTERCEPT</b>
|
||||
</div>
|
||||
<h4>Remarks</h4>
|
||||
<div>
|
||||
This macro is used to intercept concatenations performed by various other library constructs.
|
||||
It is typically used after other text to prevent eat the concatenation expand to nothing.
|
||||
This macro can only intercept integer constants in the range of <i>0</i> to <b>BOOST_PP_LIMIT_MAG</b>.
|
||||
</div>
|
||||
<h4>See Also</h4>
|
||||
<ul>
|
||||
<li><a href="limit_mag.html">BOOST_PP_LIMIT_MAG</a></li>
|
||||
</ul>
|
||||
<h4>Requirements</h4>
|
||||
<div>
|
||||
<b>Header:</b> <a href="../headers/facilities/intercept.hpp.html"><boost/preprocessor/facilities/intercept.hpp></a>
|
||||
</div>
|
||||
<h4><a class="local" onclick="toggle('sample');" onmouseover="change(this);" onmouseout="revert(this);">Sample Code</a></h4>
|
||||
<div id="sample"><pre>
|
||||
#include <boost/preprocessor/facilities/intercept.hpp>
|
||||
#include <boost/preprocessor/repetition/enum_binary_params.hpp>
|
||||
|
||||
BOOST_PP_ENUM_BINARY_PARAMS(3, class T, = U)
|
||||
// expands to class T0 = U0, class T1 = U1, class T2 = U2
|
||||
|
||||
BOOST_PP_ENUM_BINARY_PARAMS(3, class T, = int BOOST_PP_INTERCEPT)
|
||||
// expands to class T0 = int, class T1 = int, class T2 = int
|
||||
<pre></div>
|
||||
</body>
|
||||
</html>
|
27
docs.1/ref/is_iterating.html
Normal file
27
docs.1/ref/is_iterating.html
Normal file
@ -0,0 +1,27 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>BOOST_PP_IS_ITERATING</title>
|
||||
<link rel="stylesheet" type="text/css" href="../styles.css">
|
||||
<script language="javascript" type="text/javascript" src="../scripts.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<div style="margin-left: 0px;">
|
||||
The <b>BOOST_PP_IS_ITERATING</b> macro is defined when a <i>file-iteration</i> is in progress.
|
||||
</div>
|
||||
<h4>Usage</h4>
|
||||
<div class="code">
|
||||
#if !defined(<b>BOOST_PP_IS_ITERATING</b>) // ...
|
||||
</div>
|
||||
<h4>Remarks</h4>
|
||||
<div>
|
||||
If a <i>file-iteration</i> is in progress, this macro is defined as <i>1</i>.
|
||||
This means that the following will also work:
|
||||
<div>
|
||||
#if !<b>BOOST_PP_IS_ITERATING</b> // ...
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
This macro is defined to guard a file from infinite inclusion.
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
27
docs.1/ref/is_selfish.html
Normal file
27
docs.1/ref/is_selfish.html
Normal file
@ -0,0 +1,27 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>BOOST_PP_IS_SELFISH</title>
|
||||
<link rel="stylesheet" type="text/css" href="../styles.css">
|
||||
<script language="javascript" type="text/javascript" src="../scripts.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<div style="margin-left: 0px;">
|
||||
The <b>BOOST_PP_IS_SELFISH</b> macro is defined when a self-inclusion is in progress.
|
||||
</div>
|
||||
<h4>Usage</h4>
|
||||
<div class="code">
|
||||
#if !defined(<b>BOOST_PP_IS_SELFISH</b>) // ...
|
||||
</div>
|
||||
<h4>Remarks</h4>
|
||||
<div>
|
||||
If a <i>self-inclusion</i> is in progress, this macro is defined as <i>1</i>.
|
||||
This means that the following will also work:
|
||||
<div>
|
||||
#if !<b>BOOST_PP_IS_SELFISH</b> // ...
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
This macro is defined to guard a file from infinite inclusion.
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
73
docs.1/ref/iterate.html
Normal file
73
docs.1/ref/iterate.html
Normal file
@ -0,0 +1,73 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>BOOST_PP_ITERATE</title>
|
||||
<link rel="stylesheet" type="text/css" href="../styles.css">
|
||||
<script language="javascript" type="text/javascript" src="../scripts.js"></script>
|
||||
</head>
|
||||
<body onload="init('sample');">
|
||||
<div style="margin-left: 0px;">
|
||||
The <b>BOOST_PP_ITERATE</b> macro initiates a <i>file-iteration</i>.
|
||||
</div>
|
||||
<h4>Usage</h4>
|
||||
<div class="code">
|
||||
#include <b>BOOST_PP_ITERATE</b>()
|
||||
</div>
|
||||
<h4>Remarks</h4>
|
||||
<div>
|
||||
Arguments to this macro are passed as <i>external named arguments</i> in one of two
|
||||
ways--either through <b>BOOST_PP_FILENAME_<i>x</i></b> and <b>BOOST_PP_ITERATION_LIMITS</b> <i>or</i>
|
||||
through <b>BOOST_PP_ITERATION_PARAMS_<i>x</i></b>.
|
||||
</div>
|
||||
<div>
|
||||
Three pieces of information are required to perform a <i>file-iteration</i>.
|
||||
First, the name of a file to iterate over.
|
||||
This is passed via <b>BOOST_PP_FILENAME_<i>x</i></b> <i>or</i> as part of <b>BOOST_PP_ITERATION_PARAMS_<i>x</i></b>.
|
||||
The <i>file-iteration</i> mechanism will repeatedly include this file with iteration values ranging from a lower bound to an upper bound--the second and third <i>required</i> parameters.
|
||||
These two boundaries are either passed through <b>BOOST_PP_ITERATION_LIMITS</b> <i>or</i> as part of <b>BOOST_PP_ITERATION_PARAMS_<i>x</i></b>.
|
||||
</div>
|
||||
<div>
|
||||
Optionally, a fourth parameter may be passed that associates flags with an iteration.
|
||||
These flags are primarily useful to distinguish one iteration from another in the same file.
|
||||
This parameter can only be passed through <b>BOOST_PP_ITERATION_PARAMS_<i>x</i></b>.
|
||||
</div>
|
||||
<div>
|
||||
While a <i>file-iteration</i> is in progress, <b>BOOST_PP_IS_ITERATING</b> is defined as <i>1</i>.
|
||||
</div>
|
||||
<h4>See Also</h4>
|
||||
<ul>
|
||||
<li><a href="filename_x.html">BOOST_PP_FILENAME_<i>x</i></a></li>
|
||||
<li><a href="is_iterating.html">BOOST_PP_IS_ITERATING</a></li>
|
||||
<li><a href="iteration_limits.html">BOOST_PP_ITERATION_LIMITS</a></li>
|
||||
<li><a href="iteration_params_x.html">BOOST_PP_ITERATION_PARAMS_<i>x</i></a></li>
|
||||
</ul>
|
||||
<h4>Requirements</h4>
|
||||
<div>
|
||||
<b>Header:</b> <a href="../headers/iteration/iterate.hpp.html"><boost/preprocessor/iteration/iterate.hpp></a>
|
||||
</div>
|
||||
<h4><a class="local" onclick="toggle('sample');" onmouseover="change(this);" onmouseout="revert(this);">Sample Code</a></h4>
|
||||
<div id="sample"><pre>
|
||||
// file.h
|
||||
#if !BOOST_PP_IS_ITERATING
|
||||
|
||||
#ifndef FILE_H_
|
||||
#define FILE_H_
|
||||
|
||||
#include <boost/preprocessor/iteration/iterate.hpp>
|
||||
|
||||
#define BOOST_PP_ITERATION_PARAMS_1 (3, (1, 10, "file.h"))
|
||||
#include BOOST_PP_ITERATE()
|
||||
|
||||
#define BOOST_PP_FILENAME_1 "file.h"
|
||||
#define BOOST_PP_ITERATION_LIMITS (11, 20)
|
||||
#include BOOST_PP_ITERATE()
|
||||
|
||||
#endif
|
||||
|
||||
#else
|
||||
|
||||
current iteration value is BOOST_PP_ITERATION()
|
||||
|
||||
#endif
|
||||
<pre></div>
|
||||
</body>
|
||||
</html>
|
45
docs.1/ref/iteration.html
Normal file
45
docs.1/ref/iteration.html
Normal file
@ -0,0 +1,45 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>BOOST_PP_ITERATION</title>
|
||||
<link rel="stylesheet" type="text/css" href="../styles.css">
|
||||
<script language="javascript" type="text/javascript" src="../scripts.js"></script>
|
||||
</head>
|
||||
<body onload="init('sample');">
|
||||
<div style="margin-left: 0px;">
|
||||
The <b>BOOST_PP_ITERATION</b> macro expands to the iteration value of the current <i>file-iteration</i> depth.
|
||||
</div>
|
||||
<h4>Usage</h4>
|
||||
<div class="code">
|
||||
<b>BOOST_PP_ITERATION</b>()
|
||||
</div>
|
||||
<h4>Remarks</h4>
|
||||
<div>
|
||||
This macro is only valid when a <i>file-iteration</i> is in progress.
|
||||
</div>
|
||||
<h4>Requirements</h4>
|
||||
<div>
|
||||
<b>Header:</b> <a href="../headers/iteration/iterate.hpp.html"><boost/preprocessor/iteration/iterate.hpp></a>
|
||||
</div>
|
||||
<h4><a class="local" onclick="toggle('sample');" onmouseover="change(this);" onmouseout="revert(this);">Sample Code</a></h4>
|
||||
<div id="sample"><pre>
|
||||
// file.h
|
||||
#if !BOOST_PP_IS_ITERATING
|
||||
|
||||
#ifndef FILE_H_
|
||||
#define FILE_H_
|
||||
|
||||
#include <boost/preprocessor/iteration/iterate.hpp>
|
||||
|
||||
#define BOOST_PP_ITERATION_PARAMS_1 (3, (1, 3, "file.h"))
|
||||
#include BOOST_PP_ITERATE()
|
||||
|
||||
#endif
|
||||
|
||||
#elif BOOST_PP_ITERATION_DEPTH() == 1
|
||||
|
||||
value == BOOST_PP_ITERATION()
|
||||
|
||||
#endif
|
||||
<pre></div>
|
||||
</body>
|
||||
</html>
|
58
docs.1/ref/iteration_depth.html
Normal file
58
docs.1/ref/iteration_depth.html
Normal file
@ -0,0 +1,58 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>BOOST_PP_ITERATION_DEPTH</title>
|
||||
<link rel="stylesheet" type="text/css" href="../styles.css">
|
||||
<script language="javascript" type="text/javascript" src="../scripts.js"></script>
|
||||
</head>
|
||||
<body onload="init('sample');">
|
||||
<div style="margin-left: 0px;">
|
||||
The <b>BOOST_PP_ITERATION_DEPTH</b> macro expands to the current <i>file-iteration</i> depth.
|
||||
</div>
|
||||
<h4>Usage</h4>
|
||||
<div class="code">
|
||||
<b>BOOST_PP_ITERATION_DEPTH</b>()
|
||||
</div>
|
||||
<h4>Remarks</h4>
|
||||
<div>
|
||||
If a <i>file-iteration</i> is not in progress, this macro expands to <i>0</i>.
|
||||
Otherwise, it expands to the current depth of <i>file-iteration</i>.
|
||||
</div>
|
||||
<h4>Requirements</h4>
|
||||
<div>
|
||||
<b>Header:</b> <a href="../headers/iteration/iterate.hpp.html"><boost/preprocessor/iteration/iterate.hpp></a>
|
||||
</div>
|
||||
<h4><a class="local" onclick="toggle('sample');" onmouseover="change(this);" onmouseout="revert(this);">Sample Code</a></h4>
|
||||
<div id="sample"><pre>
|
||||
// file.h
|
||||
#if !BOOST_PP_IS_ITERATING
|
||||
|
||||
#ifndef FILE_H_
|
||||
#define FILE_H_
|
||||
|
||||
#include <boost/preprocessor/iteration/iterate.hpp>
|
||||
|
||||
#define BOOST_PP_ITERATION_PARAMS_1 (3, (1, 3, "file.h"))
|
||||
#include BOOST_PP_ITERATE()
|
||||
|
||||
#endif
|
||||
|
||||
#elif BOOST_PP_ITERATION_DEPTH() == 1
|
||||
|
||||
+ depth BOOST_PP_ITERATION_DEPTH()
|
||||
// ...
|
||||
|
||||
#define BOOST_PP_ITERATION_PARAMS_2 /* ... */ \
|
||||
(3, (1, BOOST_PP_ITERATION(), "file.h")) \
|
||||
/**/
|
||||
|
||||
#include BOOST_PP_ITERATE()
|
||||
|
||||
#elif BOOST_PP_ITERATION_DEPTH() == 2
|
||||
|
||||
- depth BOOST_PP_ITERATION_DEPTH()
|
||||
// ...
|
||||
|
||||
#endif
|
||||
<pre></div>
|
||||
</body>
|
||||
</html>
|
47
docs.1/ref/iteration_finish.html
Normal file
47
docs.1/ref/iteration_finish.html
Normal file
@ -0,0 +1,47 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>BOOST_PP_ITERATION_FINISH</title>
|
||||
<link rel="stylesheet" type="text/css" href="../styles.css">
|
||||
<script language="javascript" type="text/javascript" src="../scripts.js"></script>
|
||||
</head>
|
||||
<body onload="init('sample');">
|
||||
<div style="margin-left: 0px;">
|
||||
The <b>BOOST_PP_ITERATION_FINISH</b> macro expands to the upper bound of the current <i>file-iteration</i> depth.
|
||||
</div>
|
||||
<h4>Usage</h4>
|
||||
<div class="code">
|
||||
<b>BOOST_PP_ITERATION_FINISH</b>()
|
||||
</div>
|
||||
<h4>Remarks</h4>
|
||||
<div>
|
||||
This macro is only valid when a <i>file-iteration</i> is in progress.
|
||||
</div>
|
||||
<h4>Requirements</h4>
|
||||
<div>
|
||||
<b>Header:</b> <a href="../headers/iteration/iterate.hpp.html"><boost/preprocessor/iteration/iterate.hpp></a>
|
||||
</div>
|
||||
<h4><a class="local" onclick="toggle('sample');" onmouseover="change(this);" onmouseout="revert(this);">Sample Code</a></h4>
|
||||
<div id="sample"><pre>
|
||||
// file.h
|
||||
#if !BOOST_PP_IS_ITERATING
|
||||
|
||||
#ifndef FILE_H_
|
||||
#define FILE_H_
|
||||
|
||||
#include <boost/preprocessor/iteration/iterate.hpp>
|
||||
|
||||
#define BOOST_PP_ITERATION_PARAMS_1 (3, (1, 10, "file.h"))
|
||||
#include BOOST_PP_ITERATE()
|
||||
|
||||
#endif
|
||||
|
||||
#elif BOOST_PP_ITERATION_DEPTH() == 1
|
||||
|
||||
start -> BOOST_PP_ITERATION_START()
|
||||
iteration -> BOOST_PP_ITERATION()
|
||||
finish -> BOOST_PP_ITERATION_FINISH()
|
||||
|
||||
#endif
|
||||
<pre></div>
|
||||
</body>
|
||||
</html>
|
58
docs.1/ref/iteration_flags.html
Normal file
58
docs.1/ref/iteration_flags.html
Normal file
@ -0,0 +1,58 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>BOOST_PP_ITERATION_FLAGS</title>
|
||||
<link rel="stylesheet" type="text/css" href="../styles.css">
|
||||
<script language="javascript" type="text/javascript" src="../scripts.js"></script>
|
||||
</head>
|
||||
<body onload="init('sample');">
|
||||
<div style="margin-left: 0px;">
|
||||
The <b>BOOST_PP_ITERATION_FLAGS</b> macro retrieves flags associated with the current <i>file-iteration</i> depth.
|
||||
</div>
|
||||
<h4>Usage</h4>
|
||||
<div class="code">
|
||||
<b>BOOST_PP_ITERATION_FLAGS</b>()
|
||||
</div>
|
||||
<h4>Remarks</h4>
|
||||
<div>
|
||||
This macro is only valid when a <i>file-iteration</i> is in progress.
|
||||
</div>
|
||||
<h4>Requirements</h4>
|
||||
<div>
|
||||
<b>Header:</b> <a href="../headers/iteration/iterate.hpp.html"><boost/preprocessor/iteration/iterate.hpp></a>
|
||||
</div>
|
||||
<h4><a class="local" onclick="toggle('sample');" onmouseover="change(this);" onmouseout="revert(this);">Sample Code</a></h4>
|
||||
<div id="sample"><pre>
|
||||
// file.h
|
||||
#if !BOOST_PP_IS_ITERATING
|
||||
|
||||
#ifndef FILE_H_
|
||||
#define FILE_H_
|
||||
|
||||
#include <boost/preprocessor/iteration/iterate.hpp>
|
||||
|
||||
// 1st iteration:
|
||||
#define BOOST_PP_ITERATION_PARAMS_1 (4, (1, 10, "file.h", 0x0001))
|
||||
#include BOOST_PP_ITERATE()
|
||||
|
||||
// 2nd iteration:
|
||||
#define BOOST_PP_ITERATION_PARAMS_1 (4, (1, 10, "file.h", 0x0002))
|
||||
#include BOOST_PP_ITERATE()
|
||||
|
||||
#endif
|
||||
|
||||
#elif BOOST_PP_ITERATION_DEPTH() == 1 /* ... */ \
|
||||
&& BOOST_PP_ITERATION_FLAGS() == 0x0001 \
|
||||
/**/
|
||||
|
||||
{ 1st }
|
||||
|
||||
#elif BOOST_PP_ITERATION_DEPTH() == 1 /* ... */ \
|
||||
&& BOOST_PP_ITERATION_FLAGS() == 0x0002 \
|
||||
/**/
|
||||
|
||||
{ 2nd }
|
||||
|
||||
#endif
|
||||
<pre></div>
|
||||
</body>
|
||||
</html>
|
48
docs.1/ref/iteration_limits.html
Normal file
48
docs.1/ref/iteration_limits.html
Normal file
@ -0,0 +1,48 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>BOOST_PP_ITERATION_LIMITS</title>
|
||||
<link rel="stylesheet" type="text/css" href="../styles.css">
|
||||
<script language="javascript" type="text/javascript" src="../scripts.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<div style="margin-left: 0px;">
|
||||
The <b>BOOST_PP_ITERATION_LIMITS</b> macro is a user-defined <i>named external argument</i> used by <b>BOOST_PP_ITERATE</b>.
|
||||
It denotes the lower and upper bounds of a <i>file-iteration</i>.
|
||||
</div>
|
||||
<h4>Usage</h4>
|
||||
<div class="code">
|
||||
#define <b>BOOST_PP_ITERATION_LIMITS</b> (<i>start</i>, <i>finish</i>)
|
||||
</div>
|
||||
<h4>Arguments</h4>
|
||||
<dl>
|
||||
<dt>start</dt>
|
||||
<dd>
|
||||
The lower bound (inclusive) of a <i>file-iteration</i>.
|
||||
Valid values range from <i>0</i> to <b>BOOST_PP_LIMIT_ITERATION</b>.
|
||||
</dd>
|
||||
<dt>finish</dt>
|
||||
<dd>
|
||||
The upper bound (inclusive) of a <i>file-iteration</i>.
|
||||
Valid values range from <i>0</i> to <b>BOOST_PP_LIMIT_ITERATION</b>.
|
||||
</dd>
|
||||
</dl>
|
||||
<h4>Remarks</h4>
|
||||
<div>
|
||||
Note that there is a whitespace character after the macro identifier.
|
||||
</div>
|
||||
<div>
|
||||
This macro is part of the secondary method of passing arguments to <b>BOOST_PP_ITERATE</b>.
|
||||
The other part is <b>BOOST_PP_FILENAME_<i>x</i></b>. Both <i>start</i> and <i>finish</i> are <i>evaluated parameters</i>.
|
||||
This implies that they may include simple arithmetic.
|
||||
</div>
|
||||
<div>
|
||||
This macro is automatically undefined for reuse by a call to <b>BOOST_PP_ITERATE</b>.
|
||||
</div>
|
||||
<h4>See Also</h4>
|
||||
<ul>
|
||||
<li><a href="filename_x.html">BOOST_PP_FILENAME_<i>x</i></a></li>
|
||||
<li><a href="iterate.html">BOOST_PP_ITERATE</a></li>
|
||||
<li><a href="limit_iteration.html">BOOST_PP_LIMIT_ITERATION</a></li>
|
||||
</ul>
|
||||
</body>
|
||||
</html>
|
66
docs.1/ref/iteration_params_x.html
Normal file
66
docs.1/ref/iteration_params_x.html
Normal file
@ -0,0 +1,66 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>BOOST_PP_ITERATION_PARAMS_x</title>
|
||||
<link rel="stylesheet" type="text/css" href="../styles.css">
|
||||
<script language="javascript" type="text/javascript" src="../scripts.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<div style="margin-left: 0px;">
|
||||
The <b>BOOST_PP_ITERATION_PARAMS_<i>x</i></b> macro is a user-defined <i>named external argument</i> used by <b>BOOST_PP_ITERATE</b>.
|
||||
It denotes the lower bound, upper bound, and the filename of a <i>file-iteration</i>. It can optionally denote flags associated with a <i>file-iteration</i> as well.
|
||||
</div>
|
||||
<h4>Usage</h4>
|
||||
<div class="code">
|
||||
#define <b>BOOST_PP_ITERATION_PARAMS_<i>x</i></b> (<i>c</i>, (<i>start</i>, <i>finish</i>, <i>filename</i> [, <i>flags</i>]))
|
||||
</div>
|
||||
<h4>Arguments</h4>
|
||||
<dl>
|
||||
<dt>x</dt>
|
||||
<dd>
|
||||
The iteration depth of the next <i>file-iteration</i>.
|
||||
This value <i>must</i> be the current iteration depth + <i>1</i>.
|
||||
</dd>
|
||||
<dt>c</dt>
|
||||
<dd>
|
||||
The number of parameters.
|
||||
If <i>flags</i> is specified, this value must be <i>4</i>.
|
||||
Otherwise, it must be <i>3</i>.
|
||||
</dd>
|
||||
<dt>start</dt>
|
||||
<dd>
|
||||
The lower bound (inclusive) of a <i>file-iteration</i>.
|
||||
Valid values range from <i>0</i> to <b>BOOST_PP_LIMIT_ITERATION</b>.
|
||||
</dd>
|
||||
<dt>finish</dt>
|
||||
<dd>
|
||||
The upper bound (inclusive) of a <i>file-iteration</i>.
|
||||
Valid values range from <i>0</i> to <b>BOOST_PP_LIMIT_ITERATION</b>.
|
||||
</dd>
|
||||
<dt>filename</dt>
|
||||
<dd>
|
||||
A quoted or angle-bracketed filename to used as the target of a <i>file-iteration</i>.
|
||||
</dd>
|
||||
<dt>[flags]</dt>
|
||||
<dd>
|
||||
A quoted or angle-bracketed filename to used as the target of a <i>file-iteration</i>.
|
||||
</dd>
|
||||
</dl>
|
||||
<h4>Remarks</h4>
|
||||
<div>
|
||||
Note that there is a whitespace character after the macro identifier.
|
||||
</div>
|
||||
<div>
|
||||
This macro is must be defined as an <i>array</i> of arguments in one of the two formats above (with or without <i>flags</i>).
|
||||
It is the primary method of passing arguments to <b>BOOST_PP_ITERATE</b>.
|
||||
Both <i>start</i> and <i>finish</i> are <i>evaluated parameters</i>, which implies that simple arithmetic can be used.
|
||||
</div>
|
||||
<div>
|
||||
This macro is automatically undefined for reuse by a call to <b>BOOST_PP_ITERATE</b>.
|
||||
</div>
|
||||
<h4>See Also</h4>
|
||||
<ul>
|
||||
<li><a href="iterate.html">BOOST_PP_ITERATE</a></li>
|
||||
<li><a href="limit_iteration.html">BOOST_PP_LIMIT_ITERATION</a></li>
|
||||
</ul>
|
||||
</body>
|
||||
</html>
|
47
docs.1/ref/iteration_start.html
Normal file
47
docs.1/ref/iteration_start.html
Normal file
@ -0,0 +1,47 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>BOOST_PP_ITERATION_START</title>
|
||||
<link rel="stylesheet" type="text/css" href="../styles.css">
|
||||
<script language="javascript" type="text/javascript" src="../scripts.js"></script>
|
||||
</head>
|
||||
<body onload="init('sample');">
|
||||
<div style="margin-left: 0px;">
|
||||
The <b>BOOST_PP_ITERATION_START</b> macro expands to the lower bound of the current <i>file-iteration</i> depth.
|
||||
</div>
|
||||
<h4>Usage</h4>
|
||||
<div class="code">
|
||||
<b>BOOST_PP_ITERATION_START</b>()
|
||||
</div>
|
||||
<h4>Remarks</h4>
|
||||
<div>
|
||||
This macro is only valid when a <i>file-iteration</i> is in progress.
|
||||
</div>
|
||||
<h4>Requirements</h4>
|
||||
<div>
|
||||
<b>Header:</b> <a href="../headers/iteration/iterate.hpp.html"><boost/preprocessor/iteration/iterate.hpp></a>
|
||||
</div>
|
||||
<h4><a class="local" onclick="toggle('sample');" onmouseover="change(this);" onmouseout="revert(this);">Sample Code</a></h4>
|
||||
<div id="sample"><pre>
|
||||
// file.h
|
||||
#if !BOOST_PP_IS_ITERATING
|
||||
|
||||
#ifndef FILE_H_
|
||||
#define FILE_H_
|
||||
|
||||
#include <boost/preprocessor/iteration/iterate.hpp>
|
||||
|
||||
#define BOOST_PP_ITERATION_PARAMS_1 (3, (1, 10, "file.h"))
|
||||
#include BOOST_PP_ITERATE()
|
||||
|
||||
#endif
|
||||
|
||||
#elif BOOST_PP_ITERATION_DEPTH() == 1
|
||||
|
||||
start -> BOOST_PP_ITERATION_START()
|
||||
iteration -> BOOST_PP_ITERATION()
|
||||
finish -> BOOST_PP_ITERATION_FINISH()
|
||||
|
||||
#endif
|
||||
<pre></div>
|
||||
</body>
|
||||
</html>
|
55
docs.1/ref/less.html
Normal file
55
docs.1/ref/less.html
Normal file
@ -0,0 +1,55 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>BOOST_PP_LESS</title>
|
||||
<link rel="stylesheet" type="text/css" href="../styles.css">
|
||||
<script language="javascript" type="text/javascript" src="../scripts.js"></script>
|
||||
</head>
|
||||
<body onload="init('sample');">
|
||||
<div style="margin-left: 0px;">
|
||||
The <b>BOOST_PP_LESS</b> macro compares two values for lesser magnitude.
|
||||
</div>
|
||||
<h4>Usage</h4>
|
||||
<div class="code">
|
||||
<b>BOOST_PP_LESS</b>(<i>x</i>, <i>y</i>)
|
||||
</div>
|
||||
<h4>Arguments</h4>
|
||||
<dl>
|
||||
<dt>x</dt>
|
||||
<dd>
|
||||
The left operand of the comparison.
|
||||
Valid values range from <i>0</i> to <b>BOOST_PP_LIMIT_MAG</b>.
|
||||
</dd>
|
||||
<dt>y</dt>
|
||||
<dd>
|
||||
The right operand of the comparison.
|
||||
Valid values range from <i>0</i> to <b>BOOST_PP_LIMIT_MAG</b>.
|
||||
</dd>
|
||||
</dl>
|
||||
<h4>Remarks</h4>
|
||||
<div>
|
||||
If <i>x</i> is less than <i>y</i>, this macro expands to <i>1</i>.
|
||||
Otherwise, it expands to <i>0</i>.
|
||||
</div>
|
||||
<div>
|
||||
Previously, this macro could not be used inside <b>BOOST_PP_WHILE</b>.
|
||||
There is no longer any such restriction.
|
||||
It is more efficient, however, to use <b>BOOST_PP_LESS_D</b> in such a situation.
|
||||
</div>
|
||||
<h4>See Also</h4>
|
||||
<ul>
|
||||
<li><a href="less_d.html">BOOST_PP_LESS_D</a></li>
|
||||
<li><a href="limit_mag.html">BOOST_PP_LIMIT_MAG</a></li>
|
||||
</ul>
|
||||
<h4>Requirements</h4>
|
||||
<div>
|
||||
<b>Header:</b> <a href="../headers/comparison/less.hpp.html"><boost/preprocessor/comparison/less.hpp></a>
|
||||
</div>
|
||||
<h4><a class="local" onclick="toggle('sample');" onmouseover="change(this);" onmouseout="revert(this);">Sample Code</a></h4>
|
||||
<div id="sample"><pre>
|
||||
#include <boost/preprocessor/comparison/less.hpp>
|
||||
|
||||
BOOST_PP_LESS(4, 3) // expands to 0
|
||||
BOOST_PP_LESS(3, 4) // expands to 1
|
||||
<pre></div>
|
||||
</body>
|
||||
</html>
|
59
docs.1/ref/less_d.html
Normal file
59
docs.1/ref/less_d.html
Normal file
@ -0,0 +1,59 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>BOOST_PP_LESS_D</title>
|
||||
<link rel="stylesheet" type="text/css" href="../styles.css">
|
||||
<script language="javascript" type="text/javascript" src="../scripts.js"></script>
|
||||
</head>
|
||||
<body onload="init('sample');">
|
||||
<div style="margin-left: 0px;">
|
||||
The <b>BOOST_PP_LESS_D</b> macro compares two values for lesser magnitude.
|
||||
It reenters <b>BOOST_PP_WHILE</b> with maximum efficiency.
|
||||
</div>
|
||||
<h4>Usage</h4>
|
||||
<div class="code">
|
||||
<b>BOOST_PP_LESS_D</b>(<i>d</i>, <i>x</i>, <i>y</i>)
|
||||
</div>
|
||||
<h4>Arguments</h4>
|
||||
<dl>
|
||||
<dt>d</dt>
|
||||
<dd>
|
||||
The next available <b>BOOST_PP_WHILE</b> iteration.
|
||||
</dd>
|
||||
<dt>x</dt>
|
||||
<dd>
|
||||
The left operand of the comparison.
|
||||
Valid values range from <i>0</i> to <b>BOOST_PP_LIMIT_MAG</b>.
|
||||
</dd>
|
||||
<dt>y</dt>
|
||||
<dd>
|
||||
The right operand of the comparison.
|
||||
Valid values range from <i>0</i> to <b>BOOST_PP_LIMIT_MAG</b>.
|
||||
</dd>
|
||||
</dl>
|
||||
<h4>Remarks</h4>
|
||||
<div>
|
||||
If <i>x</i> is less than <i>y</i>, this macro expands to <i>1</i>.
|
||||
Otherwise, it expands to <i>0</i>.
|
||||
</div>
|
||||
<h4>See Also</h4>
|
||||
<ul>
|
||||
<li><a href="less.html">BOOST_PP_LESS</a></li>
|
||||
<li><a href="limit_mag.html">BOOST_PP_LIMIT_MAG</a></li>
|
||||
</ul>
|
||||
<h4>Requirements</h4>
|
||||
<div>
|
||||
<b>Header:</b> <a href="../headers/comparison/less.hpp.html"><boost/preprocessor/comparison/less.hpp></a>
|
||||
</div>
|
||||
<h4><a class="local" onclick="toggle('sample');" onmouseover="change(this);" onmouseout="revert(this);">Sample Code</a></h4>
|
||||
<div id="sample"><pre>
|
||||
#include <boost/preprocessor/comparison/less.hpp>
|
||||
#include <boost/preprocessor/list/filter.hpp>
|
||||
|
||||
#define LIST (1, (2, (3, (4, (5, BOOST_PP_NIL)))))
|
||||
|
||||
#define PRED(d, _, num) BOOST_PP_LESS_D(d, num, 3)
|
||||
|
||||
BOOST_PP_LIST_FILTER(PRED, nil, LIST) // expands to (1, (2, BOOST_PP_NIL))
|
||||
<pre></div>
|
||||
</body>
|
||||
</html>
|
55
docs.1/ref/less_equal.html
Normal file
55
docs.1/ref/less_equal.html
Normal file
@ -0,0 +1,55 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>BOOST_PP_LESS_EQUAL</title>
|
||||
<link rel="stylesheet" type="text/css" href="../styles.css">
|
||||
<script language="javascript" type="text/javascript" src="../scripts.js"></script>
|
||||
</head>
|
||||
<body onload="init('sample');">
|
||||
<div style="margin-left: 0px;">
|
||||
The <b>BOOST_PP_LESS_EQUAL</b> macro compares two values for equality or lesser magnitude.
|
||||
</div>
|
||||
<h4>Usage</h4>
|
||||
<div class="code">
|
||||
<b>BOOST_PP_LESS_EQUAL</b>(<i>x</i>, <i>y</i>)
|
||||
</div>
|
||||
<h4>Arguments</h4>
|
||||
<dl>
|
||||
<dt>x</dt>
|
||||
<dd>
|
||||
The left operand of the comparison.
|
||||
Valid values range from <i>0</i> to <b>BOOST_PP_LIMIT_MAG</b>.
|
||||
</dd>
|
||||
<dt>y</dt>
|
||||
<dd>
|
||||
The right operand of the comparison.
|
||||
Valid values range from <i>0</i> to <b>BOOST_PP_LIMIT_MAG</b>.
|
||||
</dd>
|
||||
</dl>
|
||||
<h4>Remarks</h4>
|
||||
<div>
|
||||
If <i>x</i> is lesser than or equal to <i>y</i>, this macro expands to <i>1</i>.
|
||||
Otherwise, it expands to <i>0</i>.
|
||||
</div>
|
||||
<div>
|
||||
Previously, this macro could not be used inside <b>BOOST_PP_WHILE</b>.
|
||||
There is no longer any such restriction.
|
||||
It is more efficient, however, to use <b>BOOST_PP_LESS_EQUAL_D</b> in such a situation.
|
||||
</div>
|
||||
<h4>See Also</h4>
|
||||
<ul>
|
||||
<li><a href="less_equal_d.html">BOOST_PP_LESS_EQUAL_D</a></li>
|
||||
<li><a href="limit_mag.html">BOOST_PP_LIMIT_MAG</a></li>
|
||||
</ul>
|
||||
<h4>Requirements</h4>
|
||||
<div>
|
||||
<b>Header:</b> <a href="../headers/comparison/less_equal.hpp.html"><boost/preprocessor/comparison/less_equal.hpp></a>
|
||||
</div>
|
||||
<h4><a class="local" onclick="toggle('sample');" onmouseover="change(this);" onmouseout="revert(this);">Sample Code</a></h4>
|
||||
<div id="sample"><pre>
|
||||
#include <boost/preprocessor/comparison/less_equal.hpp>
|
||||
|
||||
BOOST_PP_LESS_EQUAL(4, 3) // expands to 0
|
||||
BOOST_PP_LESS_EQUAL(5, 5) // expands to 1
|
||||
<pre></div>
|
||||
</body>
|
||||
</html>
|
59
docs.1/ref/less_equal_d.html
Normal file
59
docs.1/ref/less_equal_d.html
Normal file
@ -0,0 +1,59 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>BOOST_PP_LESS_EQUAL_D</title>
|
||||
<link rel="stylesheet" type="text/css" href="../styles.css">
|
||||
<script language="javascript" type="text/javascript" src="../scripts.js"></script>
|
||||
</head>
|
||||
<body onload="init('sample');">
|
||||
<div style="margin-left: 0px;">
|
||||
The <b>BOOST_PP_LESS_EQUAL_D</b> macro compares two values for equality or lesser magnitude.
|
||||
It reenters <b>BOOST_PP_WHILE</b> with maximum efficiency.
|
||||
</div>
|
||||
<h4>Usage</h4>
|
||||
<div class="code">
|
||||
<b>BOOST_PP_LESS_EQUAL_D</b>(<i>d</i>, <i>x</i>, <i>y</i>)
|
||||
</div>
|
||||
<h4>Arguments</h4>
|
||||
<dl>
|
||||
<dt>d</dt>
|
||||
<dd>
|
||||
The next available <b>BOOST_PP_WHILE</b> iteration.
|
||||
</dd>
|
||||
<dt>x</dt>
|
||||
<dd>
|
||||
The left operand of the comparison.
|
||||
Valid values range from <i>0</i> to <b>BOOST_PP_LIMIT_MAG</b>.
|
||||
</dd>
|
||||
<dt>y</dt>
|
||||
<dd>
|
||||
The right operand of the comparison.
|
||||
Valid values range from <i>0</i> to <b>BOOST_PP_LIMIT_MAG</b>.
|
||||
</dd>
|
||||
</dl>
|
||||
<h4>Remarks</h4>
|
||||
<div>
|
||||
If <i>x</i> is less than or equal to <i>y</i>, this macro expands to <i>1</i>.
|
||||
Otherwise, it expands to <i>0</i>.
|
||||
</div>
|
||||
<h4>See Also</h4>
|
||||
<ul>
|
||||
<li><a href="less_equal.html">BOOST_PP_LESS_EQUAL</a></li>
|
||||
<li><a href="limit_mag.html">BOOST_PP_LIMIT_MAG</a></li>
|
||||
</ul>
|
||||
<h4>Requirements</h4>
|
||||
<div>
|
||||
<b>Header:</b> <a href="../headers/comparison/less_equal.hpp.html"><boost/preprocessor/comparison/less_equal.hpp></a>
|
||||
</div>
|
||||
<h4><a class="local" onclick="toggle('sample');" onmouseover="change(this);" onmouseout="revert(this);">Sample Code</a></h4>
|
||||
<div id="sample"><pre>
|
||||
#include <boost/preprocessor/comparison/less_equal.hpp>
|
||||
#include <boost/preprocessor/list/filter.hpp>
|
||||
|
||||
#define LIST (1, (2, (3, (4, (5, BOOST_PP_NIL)))))
|
||||
|
||||
#define PRED(d, _, num) BOOST_PP_LESS_EQUAL_D(d, num, 4)
|
||||
|
||||
BOOST_PP_LIST_FILTER(PRED, nil, LIST) // expands to (1, (2, (3, (4, BOOST_PP_NIL))))
|
||||
<pre></div>
|
||||
</body>
|
||||
</html>
|
31
docs.1/ref/limit_bool.html
Normal file
31
docs.1/ref/limit_bool.html
Normal file
@ -0,0 +1,31 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>BOOST_PP_LIMIT_BOOL</title>
|
||||
<link rel="stylesheet" type="text/css" href="../styles.css">
|
||||
<script language="javascript" type="text/javascript" src="../scripts.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<div style="margin-left: 0px;">
|
||||
The <b>BOOST_PP_LIMIT_BOOL</b> macro defines the maximum integer value that can be passed to <b>BOOST_PP_BOOL</b>.
|
||||
</div>
|
||||
<h4>Usage</h4>
|
||||
<div class="code">
|
||||
<b>BOOST_PP_LIMIT_BOOL</b>
|
||||
</div>
|
||||
<h4>Remarks</h4>
|
||||
<div>
|
||||
If <b>BOOST_PP_CONFIG_FLAGS</b> does not include <b>BOOST_PP_CONFIG_EDG</b>,
|
||||
this macro expands to <b>BOOST_PP_INFINITY</b>.
|
||||
Otherwise it expands to <b>BOOST_PP_LIMIT_MAG</b>.
|
||||
</div>
|
||||
<h4>See Also</h4>
|
||||
<ul>
|
||||
<li><a href="infinity.html">BOOST_PP_INFINITY</a></li>
|
||||
<li><a href="limit_mag.html">BOOST_PP_LIMIT_MAG</a></li>
|
||||
</ul>
|
||||
<h4>Requirements</h4>
|
||||
<div>
|
||||
<b>Header:</b> <a href="../headers/config/limits.hpp.html"><boost/preprocessor/config/limits.hpp></a>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
24
docs.1/ref/limit_dim.html
Normal file
24
docs.1/ref/limit_dim.html
Normal file
@ -0,0 +1,24 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>BOOST_PP_LIMIT_DIM</title>
|
||||
<link rel="stylesheet" type="text/css" href="../styles.css">
|
||||
<script language="javascript" type="text/javascript" src="../scripts.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<div style="margin-left: 0px;">
|
||||
The <b>BOOST_PP_LIMIT_DIM</b> macro defines the maximum number of available <b>BOOST_PP_REPEAT</b> dimensions.
|
||||
</div>
|
||||
<h4>Usage</h4>
|
||||
<div class="code">
|
||||
<b>BOOST_PP_LIMIT_DIM</b>
|
||||
</div>
|
||||
<h4>Remarks</h4>
|
||||
<div>
|
||||
This macro currently expands to <i>3</i>.
|
||||
</div>
|
||||
<h4>Requirements</h4>
|
||||
<div>
|
||||
<b>Header:</b> <a href="../headers/config/limits.hpp.html"><boost/preprocessor/config/limits.hpp></a>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
24
docs.1/ref/limit_for.html
Normal file
24
docs.1/ref/limit_for.html
Normal file
@ -0,0 +1,24 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>BOOST_PP_LIMIT_FOR</title>
|
||||
<link rel="stylesheet" type="text/css" href="../styles.css">
|
||||
<script language="javascript" type="text/javascript" src="../scripts.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<div style="margin-left: 0px;">
|
||||
The <b>BOOST_PP_LIMIT_FOR</b> macro defines the maximum number of <b>BOOST_PP_FOR</b> repetitions.
|
||||
</div>
|
||||
<h4>Usage</h4>
|
||||
<div class="code">
|
||||
<b>BOOST_PP_LIMIT_FOR</b>
|
||||
</div>
|
||||
<h4>Remarks</h4>
|
||||
<div>
|
||||
This macro currently expands to <i>256</i>.
|
||||
</div>
|
||||
<h4>Requirements</h4>
|
||||
<div>
|
||||
<b>Header:</b> <a href="../headers/config/limits.hpp.html"><boost/preprocessor/config/limits.hpp></a>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
24
docs.1/ref/limit_iteration.html
Normal file
24
docs.1/ref/limit_iteration.html
Normal file
@ -0,0 +1,24 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>BOOST_PP_LIMIT_ITERATION</title>
|
||||
<link rel="stylesheet" type="text/css" href="../styles.css">
|
||||
<script language="javascript" type="text/javascript" src="../scripts.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<div style="margin-left: 0px;">
|
||||
The <b>BOOST_PP_LIMIT_ITERATION</b> macro defines the maximum number of <i>local</i> and <i>file</i> iterations.
|
||||
</div>
|
||||
<h4>Usage</h4>
|
||||
<div class="code">
|
||||
<b>BOOST_PP_LIMIT_ITERATION</b>
|
||||
</div>
|
||||
<h4>Remarks</h4>
|
||||
<div>
|
||||
This macro currently expands to <i>256</i>.
|
||||
</div>
|
||||
<h4>Requirements</h4>
|
||||
<div>
|
||||
<b>Header:</b> <a href="../headers/config/limits.hpp.html"><boost/preprocessor/config/limits.hpp></a>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
24
docs.1/ref/limit_iteration_dim.html
Normal file
24
docs.1/ref/limit_iteration_dim.html
Normal file
@ -0,0 +1,24 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>BOOST_PP_LIMIT_ITERATION_DIM</title>
|
||||
<link rel="stylesheet" type="text/css" href="../styles.css">
|
||||
<script language="javascript" type="text/javascript" src="../scripts.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<div style="margin-left: 0px;">
|
||||
The <b>BOOST_PP_LIMIT_ITERATION_DIM</b> macro defines the maximum depth of <i>file-iteration</i>.
|
||||
</div>
|
||||
<h4>Usage</h4>
|
||||
<div class="code">
|
||||
<b>BOOST_PP_LIMIT_ITERATION_DIM</b>
|
||||
</div>
|
||||
<h4>Remarks</h4>
|
||||
<div>
|
||||
This macro currently expands to <i>5</i>.
|
||||
</div>
|
||||
<h4>Requirements</h4>
|
||||
<div>
|
||||
<b>Header:</b> <a href="../headers/config/limits.hpp.html"><boost/preprocessor/config/limits.hpp></a>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
24
docs.1/ref/limit_mag.html
Normal file
24
docs.1/ref/limit_mag.html
Normal file
@ -0,0 +1,24 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>BOOST_PP_LIMIT_MAG</title>
|
||||
<link rel="stylesheet" type="text/css" href="../styles.css">
|
||||
<script language="javascript" type="text/javascript" src="../scripts.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<div style="margin-left: 0px;">
|
||||
The <b>BOOST_PP_LIMIT_MAG</b> macro defines the maximum input and result magnitudes of arithmetic.
|
||||
</div>
|
||||
<h4>Usage</h4>
|
||||
<div class="code">
|
||||
<b>BOOST_PP_LIMIT_MAG</b>
|
||||
</div>
|
||||
<h4>Remarks</h4>
|
||||
<div>
|
||||
This macro currently expands to <i>256</i>.
|
||||
</div>
|
||||
<h4>Requirements</h4>
|
||||
<div>
|
||||
<b>Header:</b> <a href="../headers/config/limits.hpp.html"><boost/preprocessor/config/limits.hpp></a>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
25
docs.1/ref/limit_repeat.html
Normal file
25
docs.1/ref/limit_repeat.html
Normal file
@ -0,0 +1,25 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>BOOST_PP_LIMIT_REPEAT</title>
|
||||
<link rel="stylesheet" type="text/css" href="../styles.css">
|
||||
<script language="javascript" type="text/javascript" src="../scripts.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<div style="margin-left: 0px;">
|
||||
The <b>BOOST_PP_LIMIT_REPEAT</b> macro defines the maximum number of repetitions supported by each <b>BOOST_PP_REPEAT</b> dimension.
|
||||
</div>
|
||||
<h4>Usage</h4>
|
||||
<div class="code">
|
||||
<b>BOOST_PP_LIMIT_REPEAT</b>
|
||||
</div>
|
||||
<h4>Remarks</h4>
|
||||
<div>
|
||||
If <b>BOOST_PP_CONFIG_UNROLLED</b> is <i>1</i>, this macro currently expands to <i>128</i>.
|
||||
Otherwise, it expands to <i>256</i>.
|
||||
</div>
|
||||
<h4>Requirements</h4>
|
||||
<div>
|
||||
<b>Header:</b> <a href="../headers/config/limits.hpp.html"><boost/preprocessor/config/limits.hpp></a>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
24
docs.1/ref/limit_slot_count.html
Normal file
24
docs.1/ref/limit_slot_count.html
Normal file
@ -0,0 +1,24 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>BOOST_PP_LIMIT_SLOT_COUNT</title>
|
||||
<link rel="stylesheet" type="text/css" href="../styles.css">
|
||||
<script language="javascript" type="text/javascript" src="../scripts.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<div style="margin-left: 0px;">
|
||||
The <b>BOOST_PP_LIMIT_SLOT_COUNT</b> macro defines the number of available <i>evaluated slots</i>.
|
||||
</div>
|
||||
<h4>Usage</h4>
|
||||
<div class="code">
|
||||
<b>BOOST_PP_LIMIT_SLOT_COUNT</b>
|
||||
</div>
|
||||
<h4>Remarks</h4>
|
||||
<div>
|
||||
This macro currently expands to <i>5</i>.
|
||||
</div>
|
||||
<h4>Requirements</h4>
|
||||
<div>
|
||||
<b>Header:</b> <a href="../headers/config/limits.hpp.html"><boost/preprocessor/config/limits.hpp></a>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
24
docs.1/ref/limit_slot_sig.html
Normal file
24
docs.1/ref/limit_slot_sig.html
Normal file
@ -0,0 +1,24 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>BOOST_PP_LIMIT_SLOT_SIG</title>
|
||||
<link rel="stylesheet" type="text/css" href="../styles.css">
|
||||
<script language="javascript" type="text/javascript" src="../scripts.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<div style="margin-left: 0px;">
|
||||
The <b>BOOST_PP_LIMIT_SLOT_SIG</b> macro defines the number of significant base-10 digits that can be evaluated by the <i>slot</i> mechanism.
|
||||
</div>
|
||||
<h4>Usage</h4>
|
||||
<div class="code">
|
||||
<b>BOOST_PP_LIMIT_SLOT_SIG</b>
|
||||
</div>
|
||||
<h4>Remarks</h4>
|
||||
<div>
|
||||
This macro currently expands to <i>10</i>.
|
||||
</div>
|
||||
<h4>Requirements</h4>
|
||||
<div>
|
||||
<b>Header:</b> <a href="../headers/config/limits.hpp.html"><boost/preprocessor/config/limits.hpp></a>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
24
docs.1/ref/limit_tuple.html
Normal file
24
docs.1/ref/limit_tuple.html
Normal file
@ -0,0 +1,24 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>BOOST_PP_LIMIT_TUPLE</title>
|
||||
<link rel="stylesheet" type="text/css" href="../styles.css">
|
||||
<script language="javascript" type="text/javascript" src="../scripts.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<div style="margin-left: 0px;">
|
||||
The <b>BOOST_PP_LIMIT_TUPLE</b> macro defines the maximum <i>tuple</i> size supported by the library.
|
||||
</div>
|
||||
<h4>Usage</h4>
|
||||
<div class="code">
|
||||
<b>BOOST_PP_LIMIT_TUPLE</b>
|
||||
</div>
|
||||
<h4>Remarks</h4>
|
||||
<div>
|
||||
This macro currently expands to <i>25</i>.
|
||||
</div>
|
||||
<h4>Requirements</h4>
|
||||
<div>
|
||||
<b>Header:</b> <a href="../headers/config/limits.hpp.html"><boost/preprocessor/config/limits.hpp></a>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
24
docs.1/ref/limit_while.html
Normal file
24
docs.1/ref/limit_while.html
Normal file
@ -0,0 +1,24 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>BOOST_PP_LIMIT_WHILE</title>
|
||||
<link rel="stylesheet" type="text/css" href="../styles.css">
|
||||
<script language="javascript" type="text/javascript" src="../scripts.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<div style="margin-left: 0px;">
|
||||
The <b>BOOST_PP_LIMIT_WHILE</b> macro defines the maximum number of <b>BOOST_PP_WHILE</b> iterations.
|
||||
</div>
|
||||
<h4>Usage</h4>
|
||||
<div class="code">
|
||||
<b>BOOST_PP_LIMIT_WHILE</b>
|
||||
</div>
|
||||
<h4>Remarks</h4>
|
||||
<div>
|
||||
This macro currently expands to <i>256</i>.
|
||||
</div>
|
||||
<h4>Requirements</h4>
|
||||
<div>
|
||||
<b>Header:</b> <a href="../headers/config/limits.hpp.html"><boost/preprocessor/config/limits.hpp></a>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
103
docs.1/ref/line.html
Normal file
103
docs.1/ref/line.html
Normal file
@ -0,0 +1,103 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>BOOST_PP_LINE</title>
|
||||
<link rel="stylesheet" type="text/css" href="../styles.css">
|
||||
<script language="javascript" type="text/javascript" src="../scripts.js"></script>
|
||||
</head>
|
||||
<body onload="init('sample');">
|
||||
<div style="margin-left: 0px;">
|
||||
The <b>BOOST_PP_LINE</b> macro places notes encoded as line directives in the preprocessing output.
|
||||
</div>
|
||||
<h4>Usage</h4>
|
||||
<div class="code">
|
||||
#line <b>BOOST_PP_LINE</b>(<i>line</i>, <i>file</i>)
|
||||
</div>
|
||||
<h4>Arguments</h4>
|
||||
<dl>
|
||||
<dt>line</dt>
|
||||
<dd>
|
||||
The new line number of the trailing line.
|
||||
The predefined macro <i>__LINE__</i> is commonly used.
|
||||
</dd>
|
||||
<dt>file</dt>
|
||||
<dd>
|
||||
Typically the name of the current file.
|
||||
However, any informative text will work.
|
||||
This text is internally stringized, so quotation marks are unnecessary.
|
||||
</dd>
|
||||
</dl>
|
||||
<h4>Remarks</h4>
|
||||
<div>
|
||||
If the macro <b>BOOST_PP_CONFIG_EXTENDED_LINE_INFO</b> is defined as <i>1</i> and a <i>file-iteration</i>
|
||||
is in progress, this macro will automatically insert debugging information about the state of <i>file-iteration</i>.
|
||||
This information will show the all of the current iteration values with the inner most iteration last.
|
||||
</div>
|
||||
<div>
|
||||
This information is useful when errors might be spanning multiple iterations of the same source text.
|
||||
Finding any errors is sometimes less than straightforward.
|
||||
Use of this macro can provide information to make this much easier.
|
||||
For example, instead of getting several errors like this:
|
||||
<div><i>
|
||||
"file.hpp", line 2: error: expected a ";"<br>
|
||||
"file.hpp", line 4: error: improperly terminated macro invocation<br>
|
||||
</i></div>
|
||||
You might get something like this instead....
|
||||
<i><div>
|
||||
"file.hpp [1]", line 2: error: expected a ";"<br>
|
||||
"file.hpp [5]", line 4: error: improperly terminated macro invocation<br>
|
||||
</i></div>
|
||||
It is immediately evident that this error is spanning multiple iterations of the same source text.
|
||||
If it wasn't, the same errors would occur on each iteration.
|
||||
</div>
|
||||
<div>
|
||||
It must be noted however, that some compilers don't like filenames that aren't actually files.
|
||||
Those compilers typically issues warnings about the bad filename.
|
||||
This makes it a good idea to only define <b>BOOST_PP_CONFIG_EXTENDED_LINE_INFO</b> to <i>1</i> <i>only</i> when debugging.
|
||||
</div>
|
||||
<h4>See Also</h4>
|
||||
<ul>
|
||||
<li><a href="config_extended_line_info.html">BOOST_PP_CONFIG_EXTENDED_LINE_INFO</a></li>
|
||||
</ul>
|
||||
<h4>Requirements</h4>
|
||||
<div>
|
||||
<b>Header:</b> <a href="../headers/debug/line.hpp.html"><boost/preprocessor/debug/line.hpp></a>
|
||||
</div>
|
||||
<h4><a class="local" onclick="toggle('sample');" onmouseover="change(this);" onmouseout="revert(this);">Sample Code</a></h4>
|
||||
<div id="sample"><pre>
|
||||
// sample.cpp
|
||||
|
||||
#if !defined(BOOST_PP_IS_ITERATING)
|
||||
|
||||
#define BOOST_PP_CONFIG_EXTENDED_LINE_INFO 1
|
||||
|
||||
#include <boost/preprocessor/arithmetic/dec.hpp>
|
||||
#include <boost/preprocessor/cat.hpp>
|
||||
#include <boost/preprocessor/debug/line.hpp>
|
||||
#include <boost/preprocessor/iteration/iterate.hpp>
|
||||
|
||||
namespace sample {
|
||||
|
||||
#define BOOST_PP_ITERATION_PARAMS_1 (3, (1, 5, "sample.cpp"))
|
||||
#include BOOST_PP_ITERATE()
|
||||
|
||||
} // sample
|
||||
|
||||
int main(void) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
#line BOOST_PP_LINE(1, sample.cpp)
|
||||
|
||||
int BOOST_PP_CAT(x, BOOST_PP_ITERATION())); // extra parenthesis
|
||||
|
||||
struct BOOST_PP_CAT(s, BOOST_PP_DEC(BOOST_PP_ITERATION()) {
|
||||
// missing a parenthesis
|
||||
// ...
|
||||
};
|
||||
|
||||
#endif
|
||||
<pre></div>
|
||||
</body>
|
||||
</html>
|
59
docs.1/ref/list_append.html
Normal file
59
docs.1/ref/list_append.html
Normal file
@ -0,0 +1,59 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>BOOST_PP_LIST_APPEND</title>
|
||||
<link rel="stylesheet" type="text/css" href="../styles.css">
|
||||
<script language="javascript" type="text/javascript" src="../scripts.js"></script>
|
||||
</head>
|
||||
<body onload="init('sample');">
|
||||
<div style="margin-left: 0px;">
|
||||
The <b>BOOST_PP_LIST_APPEND</b> macro appends two <i>lists</i>.
|
||||
</div>
|
||||
<h4>Usage</h4>
|
||||
<div class="code">
|
||||
<b>BOOST_PP_LIST_APPEND</b>(<i>a</i>, <i>b</i>)
|
||||
</div>
|
||||
<h4>Arguments</h4>
|
||||
<dl>
|
||||
<dt>a</dt>
|
||||
<dd>
|
||||
The first <i>list</i>.
|
||||
</dd>
|
||||
<dt>b</dt>
|
||||
<dd>
|
||||
The second <i>list</i>.
|
||||
</dd>
|
||||
</dl>
|
||||
<h4>Remarks</h4>
|
||||
<div>
|
||||
This macro appends two lists.
|
||||
For example, if <i>a</i> is (<i>1</i>, (<i>2</i>, (<i>3</i>, <b>BOOST_PP_NIL</b>))) and <i>b</i> is (<i>4</i>, (<i>5</i>, <b>BOOST_PP_NIL</b>)),
|
||||
this macro will expand to:
|
||||
<div>
|
||||
(<i>1</i>, (<i>2</i>, (<i>3</i>, (<i>4</i>, (<i>5</i>, <b>BOOST_PP_NIL</b>)))))
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
Previously, this macro could not be used inside <b>BOOST_PP_WHILE</b>.
|
||||
There is no longer any such restriction.
|
||||
It is more efficient, however, to use <b>BOOST_PP_LIST_APPEND_D</b> in such a situation.
|
||||
</div>
|
||||
<h4>See Also</h4>
|
||||
<ul>
|
||||
<li><a href="list_append_d.html">BOOST_PP_LIST_APPEND_D</a></li>
|
||||
</ul>
|
||||
<h4>Requirements</h4>
|
||||
<div>
|
||||
<b>Header:</b> <a href="../headers/list/append.hpp.html"><boost/preprocessor/list/append.hpp></a>
|
||||
</div>
|
||||
<h4><a class="local" onclick="toggle('sample');" onmouseover="change(this);" onmouseout="revert(this);">Sample Code</a></h4>
|
||||
<div id="sample"><pre>
|
||||
#include <boost/preprocessor/list/append.hpp>
|
||||
|
||||
#define L1 (a, (b, (c, BOOST_PP_NIL)))
|
||||
#define L2 (x, (y, (z, BOOST_PP_NIL)))
|
||||
|
||||
BOOST_PP_LIST_APPEND(L1, L2)
|
||||
// expands to (a, (b, (c, (x, (y, (z, BOOST_PP_NIL))))))
|
||||
<pre></div>
|
||||
</body>
|
||||
</html>
|
86
docs.1/ref/list_append_d.html
Normal file
86
docs.1/ref/list_append_d.html
Normal file
@ -0,0 +1,86 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>BOOST_PP_LIST_APPEND_D</title>
|
||||
<link rel="stylesheet" type="text/css" href="../styles.css">
|
||||
<script language="javascript" type="text/javascript" src="../scripts.js"></script>
|
||||
</head>
|
||||
<body onload="init('sample');">
|
||||
<div style="margin-left: 0px;">
|
||||
The <b>BOOST_PP_LIST_APPEND_D</b> macro appends two <i>lists</i>.
|
||||
It reenters <b>BOOST_PP_WHILE</b> with maximum efficiency.
|
||||
</div>
|
||||
<h4>Usage</h4>
|
||||
<div class="code">
|
||||
<b>BOOST_PP_LIST_APPEND_D</b>(<i>d</i>, <i>a</i>, <i>b</i>)
|
||||
</div>
|
||||
<h4>Arguments</h4>
|
||||
<dl>
|
||||
<dt>d</dt>
|
||||
<dd>
|
||||
The next available <b>BOOST_PP_WHILE</b> iteration.
|
||||
</dd>
|
||||
<dt>a</dt>
|
||||
<dd>
|
||||
The first <i>list</i>.
|
||||
</dd>
|
||||
<dt>b</dt>
|
||||
<dd>
|
||||
The second <i>list</i>.
|
||||
</dd>
|
||||
</dl>
|
||||
<h4>Remarks</h4>
|
||||
<div>
|
||||
This macro appends two lists.
|
||||
For example, if <i>a</i> is (<i>1</i>, (<i>2</i>, (<i>3</i>, <b>BOOST_PP_NIL</b>))) and <i>b</i> is (<i>4</i>, (<i>5</i>, <b>BOOST_PP_NIL</b>)),
|
||||
this macro will expand to:
|
||||
<div>
|
||||
(<i>1</i>, (<i>2</i>, (<i>3</i>, (<i>4</i>, (<i>5</i>, <b>BOOST_PP_NIL</b>)))))
|
||||
</div>
|
||||
</div>
|
||||
<h4>See Also</h4>
|
||||
<ul>
|
||||
<li><a href="list_append.html">BOOST_PP_LIST_APPEND</a></li>
|
||||
</ul>
|
||||
<h4>Requirements</h4>
|
||||
<div>
|
||||
<b>Header:</b> <a href="../headers/list/append.hpp.html"><boost/preprocessor/list/append.hpp></a>
|
||||
</div>
|
||||
<h4><a class="local" onclick="toggle('sample');" onmouseover="change(this);" onmouseout="revert(this);">Sample Code</a></h4>
|
||||
<div id="sample"><pre>
|
||||
#include <boost/preprocessor/arithmetic/dec.hpp>
|
||||
#include <boost/preprocessor/control/while.hpp>
|
||||
#include <boost/preprocessor/list/append.hpp>
|
||||
#include <boost/preprocessor/tuple/elem.hpp>
|
||||
|
||||
#define LIST (1, (2, (3, BOOST_PP_NIL)))
|
||||
|
||||
#define PRED(d, state) BOOST_PP_TUPLE_ELEM(3, 1, state)
|
||||
|
||||
#define OP(d, state) /* .................. */ \
|
||||
( \
|
||||
BOOST_PP_LIST_APPEND_D( \
|
||||
d, BOOST_PP_TUPLE_ELEM(3, 0, state), \
|
||||
BOOST_PP_TUPLE_ELEM(3, 2, state) \
|
||||
), \
|
||||
BOOST_PP_DEC( \
|
||||
BOOST_PP_TUPLE_ELEM(3, 1, state) \
|
||||
), \
|
||||
BOOST_PP_TUPLE_ELEM(3, 2, state) \
|
||||
) \
|
||||
/**/
|
||||
|
||||
#define LIST_MULTIPLY(c, list) /* ... */ \
|
||||
BOOST_PP_TUPLE_ELEM( \
|
||||
3, 0, \
|
||||
BOOST_PP_WHILE( \
|
||||
PRED, OP, \
|
||||
(BOOST_PP_NIL, c, list) \
|
||||
) \
|
||||
) \
|
||||
/**/
|
||||
|
||||
LIST_MULTIPLY(3, LIST)
|
||||
// expands to (1, (2, (3, (1, (2, (3, (1, (2, (3, BOOST_PP_NIL)))))))))
|
||||
<pre></div>
|
||||
</body>
|
||||
</html>
|
51
docs.1/ref/list_at.html
Normal file
51
docs.1/ref/list_at.html
Normal file
@ -0,0 +1,51 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>BOOST_PP_LIST_AT</title>
|
||||
<link rel="stylesheet" type="text/css" href="../styles.css">
|
||||
<script language="javascript" type="text/javascript" src="../scripts.js"></script>
|
||||
</head>
|
||||
<body onload="init('sample');">
|
||||
<div style="margin-left: 0px;">
|
||||
The <b>BOOST_PP_LIST_AT</b> macro extracts an element in a <i>list</i>.
|
||||
</div>
|
||||
<h4>Usage</h4>
|
||||
<div class="code">
|
||||
<b>BOOST_PP_LIST_AT</b>(<i>list</i>, <i>index</i>)
|
||||
</div>
|
||||
<h4>Arguments</h4>
|
||||
<dl>
|
||||
<dt>list</dt>
|
||||
<dd>
|
||||
The <i>list</i> from which a element is to be extracted.
|
||||
This <i>list</i> must have at least <i>index</i> + <i>1</i> elements.
|
||||
</dd>
|
||||
<dt>index</dt>
|
||||
<dd>
|
||||
The zero-based position in the <i>list</i> of the element to be extracted.
|
||||
</dd>
|
||||
</dl>
|
||||
<h4>Remarks</h4>
|
||||
<div>
|
||||
Previously, this macro could not be used inside <b>BOOST_PP_WHILE</b>.
|
||||
There is no longer any such restriction.
|
||||
It is more efficient, however, to use <b>BOOST_PP_LIST_AT_D</b> in such a situation.
|
||||
</div>
|
||||
<h4>See Also</h4>
|
||||
<ul>
|
||||
<li><a href="list_at_d.html">BOOST_PP_LIST_AT_D</a></li>
|
||||
</ul>
|
||||
<h4>Requirements</h4>
|
||||
<div>
|
||||
<b>Header:</b> <a href="../headers/list/at.hpp.html"><boost/preprocessor/list/at.hpp></a>
|
||||
</div>
|
||||
<h4><a class="local" onclick="toggle('sample');" onmouseover="change(this);" onmouseout="revert(this);">Sample Code</a></h4>
|
||||
<div id="sample"><pre>
|
||||
#include <boost/preprocessor/list/at.hpp>
|
||||
|
||||
#define LIST (a, (b, (c, BOOST_PP_NIL)))
|
||||
|
||||
BOOST_PP_LIST_AT(LIST, 0) // expands to a
|
||||
BOOST_PP_LIST_AT(LIST, 2) // expands to c
|
||||
<pre></div>
|
||||
</body>
|
||||
</html>
|
53
docs.1/ref/list_at_d.html
Normal file
53
docs.1/ref/list_at_d.html
Normal file
@ -0,0 +1,53 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>BOOST_PP_LIST_AT_D</title>
|
||||
<link rel="stylesheet" type="text/css" href="../styles.css">
|
||||
<script language="javascript" type="text/javascript" src="../scripts.js"></script>
|
||||
</head>
|
||||
<body onload="init('sample');">
|
||||
<div style="margin-left: 0px;">
|
||||
The <b>BOOST_PP_LIST_AT_D</b> macro extracts an element in a <i>list</i>.
|
||||
It reenters <b>BOOST_PP_WHILE</b> with maximum efficiency.
|
||||
</div>
|
||||
<h4>Usage</h4>
|
||||
<div class="code">
|
||||
<b>BOOST_PP_LIST_AT_D</b>(<i>d</i>, <i>list</i>, <i>index</i>)
|
||||
</div>
|
||||
<h4>Arguments</h4>
|
||||
<dl>
|
||||
<dt>d</dt>
|
||||
<dd>
|
||||
The next available <b>BOOST_PP_WHILE</b> iteration.
|
||||
</dd>
|
||||
<dt>list</dt>
|
||||
<dd>
|
||||
The <i>list</i> from which a element is to be extracted.
|
||||
This <i>list</i> must have at least <i>index</i> + <i>1</i> elements.
|
||||
</dd>
|
||||
<dt>index</dt>
|
||||
<dd>
|
||||
The zero-based position in the <i>list</i> of the element to be extracted.
|
||||
</dd>
|
||||
</dl>
|
||||
<h4>See Also</h4>
|
||||
<ul>
|
||||
<li><a href="list_at.html">BOOST_PP_LIST_AT</a></li>
|
||||
</ul>
|
||||
<h4>Requirements</h4>
|
||||
<div>
|
||||
<b>Header:</b> <a href="../headers/list/at.hpp.html"><boost/preprocessor/list/at.hpp></a>
|
||||
</div>
|
||||
<h4><a class="local" onclick="toggle('sample');" onmouseover="change(this);" onmouseout="revert(this);">Sample Code</a></h4>
|
||||
<div id="sample"><pre>
|
||||
#include <boost/preprocessor/control/while.hpp>
|
||||
#include <boost/preprocessor/list/at.hpp>
|
||||
|
||||
#define LIST (7, (2, (0, (1, BOOST_PP_NIL))))
|
||||
|
||||
#define PRED(d, state) BOOST_PP_LIST_AT_D(d, state, 0)
|
||||
#define OP(d, state) BOOST_PP_LIST_REST(state)
|
||||
|
||||
BOOST_PP_WHILE(PRED, OP, LIST) // expands to (0, (1, BOOST_PP_NIL))
|
||||
<pre></div>
|
||||
</body>
|
||||
</html>
|
48
docs.1/ref/list_cat.html
Normal file
48
docs.1/ref/list_cat.html
Normal file
@ -0,0 +1,48 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>BOOST_PP_LIST_CAT</title>
|
||||
<link rel="stylesheet" type="text/css" href="../styles.css">
|
||||
<script language="javascript" type="text/javascript" src="../scripts.js"></script>
|
||||
</head>
|
||||
<body onload="init('sample');">
|
||||
<div style="margin-left: 0px;">
|
||||
The <b>BOOST_PP_LIST_CAT</b> macro concatenates all elements in a <i>list</i>.
|
||||
</div>
|
||||
<h4>Usage</h4>
|
||||
<div class="code">
|
||||
<b>BOOST_PP_LIST_CAT</b>(<i>list</i>)
|
||||
</div>
|
||||
<h4>Arguments</h4>
|
||||
<dl>
|
||||
<dt>list</dt>
|
||||
<dd>
|
||||
The <i>list</i> whose elements are to be concatenated.
|
||||
</dd>
|
||||
</dl>
|
||||
<h4>Remarks</h4>
|
||||
<div>
|
||||
Elements are concatenated left-to-right starting with index <i>0</i>.
|
||||
</div>
|
||||
<div>
|
||||
Previously, this macro could not be used inside <b>BOOST_PP_WHILE</b>.
|
||||
There is no longer any such restriction.
|
||||
It is more efficient, however, to use <b>BOOST_PP_LIST_CAT_D</b> in such a situation.
|
||||
</div>
|
||||
<h4>See Also</h4>
|
||||
<ul>
|
||||
<li><a href="list_cat_d.html">BOOST_PP_LIST_CAT_D</a></li>
|
||||
</ul>
|
||||
<h4>Requirements</h4>
|
||||
<div>
|
||||
<b>Header:</b> <a href="../headers/list/cat.hpp.html"><boost/preprocessor/list/cat.hpp></a>
|
||||
</div>
|
||||
<h4><a class="local" onclick="toggle('sample');" onmouseover="change(this);" onmouseout="revert(this);">Sample Code</a></h4>
|
||||
<div id="sample"><pre>
|
||||
#include <boost/preprocessor/list/cat.hpp>
|
||||
|
||||
#define LIST (a, (b, (c, BOOST_PP_NIL)))
|
||||
|
||||
BOOST_PP_LIST_CAT(LIST) // expands to abc
|
||||
<pre></div>
|
||||
</body>
|
||||
</html>
|
57
docs.1/ref/list_cat_d.html
Normal file
57
docs.1/ref/list_cat_d.html
Normal file
@ -0,0 +1,57 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>BOOST_PP_LIST_CAT_D</title>
|
||||
<link rel="stylesheet" type="text/css" href="../styles.css">
|
||||
<script language="javascript" type="text/javascript" src="../scripts.js"></script>
|
||||
</head>
|
||||
<body onload="init('sample');">
|
||||
<div style="margin-left: 0px;">
|
||||
The <b>BOOST_PP_LIST_CAT_D</b> macro concatenates all elements in a <i>list</i>.
|
||||
It reenters <b>BOOST_PP_WHILE</b> with maximum efficiency.
|
||||
</div>
|
||||
<h4>Usage</h4>
|
||||
<div class="code">
|
||||
<b>BOOST_PP_LIST_CAT_D</b>(<i>d</i>, <i>list</i>)
|
||||
</div>
|
||||
<h4>Arguments</h4>
|
||||
<dl>
|
||||
<dt>d</dt>
|
||||
<dd>
|
||||
The next available <b>BOOST_PP_WHILE</b> iteration.
|
||||
</dd>
|
||||
<dt>list</dt>
|
||||
<dd>
|
||||
The <i>list</i> whose elements are to be concatenated.
|
||||
</dd>
|
||||
</dl>
|
||||
<h4>Remarks</h4>
|
||||
<div>
|
||||
Elements are concatenated left-to-right starting with index <i>0</i>.
|
||||
</div>
|
||||
<h4>See Also</h4>
|
||||
<ul>
|
||||
<li><a href="list_cat.html">BOOST_PP_LIST_CAT</a></li>
|
||||
</ul>
|
||||
<h4>Requirements</h4>
|
||||
<div>
|
||||
<b>Header:</b> <a href="../headers/list/cat.hpp.html"><boost/preprocessor/list/cat.hpp></a>
|
||||
</div>
|
||||
<h4><a class="local" onclick="toggle('sample');" onmouseover="change(this);" onmouseout="revert(this);">Sample Code</a></h4>
|
||||
<div id="sample"><pre>
|
||||
#include <boost/preprocessor/cat.hpp>
|
||||
#include <boost/preprocessor/list/cat.hpp>
|
||||
#include <boost/preprocessor/list/fold_left.hpp>
|
||||
|
||||
#define LISTS /* ............. */ \
|
||||
((a, (b, BOOST_PP_NIL)), \
|
||||
((d, (e, BOOST_PP_NIL)), \
|
||||
((e, (f, BOOST_PP_NIL)), \
|
||||
BOOST_PP_NIL))) \
|
||||
/**/
|
||||
|
||||
#define OP(d, state, x) BOOST_PP_CAT(state, BOOST_PP_LIST_CAT_D(d, x))
|
||||
|
||||
BOOST_PP_LIST_FOLD_LEFT(OP, _, LISTS) // expands to _abcdef
|
||||
<pre></div>
|
||||
</body>
|
||||
</html>
|
77
docs.1/ref/list_cons.html
Normal file
77
docs.1/ref/list_cons.html
Normal file
@ -0,0 +1,77 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>BOOST_PP_LIST_CONS</title>
|
||||
<link rel="stylesheet" type="text/css" href="../styles.css">
|
||||
<script language="javascript" type="text/javascript" src="../scripts.js"></script>
|
||||
</head>
|
||||
<body onload="init('sample');">
|
||||
<div style="margin-left: 0px;">
|
||||
The <b>BOOST_PP_LIST_CONS</b> macro is a <i>list</i> constructor.
|
||||
</div>
|
||||
<h4>Usage</h4>
|
||||
<div class="code">
|
||||
<b>BOOST_PP_LIST_CONS</b>(<i>head</i>, <i>tail</i>)
|
||||
</div>
|
||||
<h4>Arguments</h4>
|
||||
<dl>
|
||||
<dt>head</dt>
|
||||
<dd>
|
||||
An element in a <i>list</i>.
|
||||
</dd>
|
||||
<dt>tail</dt>
|
||||
<dd>
|
||||
Either a <i>list</i>, <b>BOOST_PP_LIST_NIL</b>, or <b>BOOST_PP_NIL</b>.
|
||||
</dd>
|
||||
</dl>
|
||||
<h4>Remarks</h4>
|
||||
<div>
|
||||
This macro appends a new head to an existing <i>list</i> or creates a <i>list</i> from <b>BOOST_PP_LIST_NIL</b>.
|
||||
</div>
|
||||
<div>
|
||||
This macro is no longer necessary.
|
||||
For example...
|
||||
<div>
|
||||
<b>BOOST_PP_LIST_CONS</b>(a, <b>BOOST_PP_LIST_CONS</b>(b, <b>BOOST_PP_LIST_NIL</b>)))
|
||||
</div>
|
||||
...is just an explicit way of writing the following:
|
||||
<div>
|
||||
(a, (b, <b>BOOST_PP_NIL</b>))
|
||||
</div>
|
||||
Because of this, this macro is deprecated.
|
||||
</div>
|
||||
<h4>See Also</h4>
|
||||
<ul>
|
||||
<li><a href="list_nil.html">BOOST_PP_LIST_NIL</a></li>
|
||||
<li><a href="nil.html">BOOST_PP_NIL</a></li>
|
||||
</ul>
|
||||
<h4>Requirements</h4>
|
||||
<div>
|
||||
<b>Header:</b> <a href="../headers/list/adt.hpp.html"><boost/preprocessor/list/adt.hpp></a>
|
||||
</div>
|
||||
<h4><a class="local" onclick="toggle('sample');" onmouseover="change(this);" onmouseout="revert(this);">Sample Code</a></h4>
|
||||
<div id="sample"><pre>
|
||||
#include <boost/preprocessor/list/adt.hpp>
|
||||
|
||||
#define OLD /* ........... */ \
|
||||
BOOST_PP_LIST_CONS( \
|
||||
a, \
|
||||
BOOST_PP_LIST_CONS( \
|
||||
b, \
|
||||
BOOST_PP_LIST_CONS( \
|
||||
c, \
|
||||
BOOST_PP_LIST_NIL \
|
||||
) \
|
||||
) \
|
||||
) \
|
||||
/**/
|
||||
|
||||
#define NEW (a, (b, (c, BOOST_PP_NIL)))
|
||||
|
||||
BOOST_PP_LIST_FIRST(OLD) == BOOST_PP_LIST_FIRST(NEW)
|
||||
// expands to a == a
|
||||
|
||||
BOOST_PP_LIST_REST(OLD) == BOOST_PP_LIST_REST(NEW)
|
||||
// expands to (b, (c, BOOST_PP_NIL)) == (b, (c, BOOST_PP_NIL))
|
||||
<pre></div>
|
||||
</body>
|
||||
</html>
|
52
docs.1/ref/list_enum.html
Normal file
52
docs.1/ref/list_enum.html
Normal file
@ -0,0 +1,52 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>BOOST_PP_LIST_ENUM</title>
|
||||
<link rel="stylesheet" type="text/css" href="../styles.css">
|
||||
<script language="javascript" type="text/javascript" src="../scripts.js"></script>
|
||||
</head>
|
||||
<body onload="init('sample');">
|
||||
<div style="margin-left: 0px;">
|
||||
The <b>BOOST_PP_LIST_ENUM</b> macro converts a <i>list</i> to a comma-separated list.
|
||||
</div>
|
||||
<h4>Usage</h4>
|
||||
<div class="code">
|
||||
<b>BOOST_PP_LIST_ENUM</b>(<i>list</i>)
|
||||
</div>
|
||||
<h4>Arguments</h4>
|
||||
<dl>
|
||||
<dt>list</dt>
|
||||
<dd>
|
||||
The <i>list</i> to be converted.
|
||||
</dd>
|
||||
</dl>
|
||||
<h4>Remarks</h4>
|
||||
<div>
|
||||
If <i>list</i> is, for example, (<i>a</i>, (<i>b</i>, (<i>c</i>, <b>BOOST_PP_NIL</b>))),
|
||||
this macro will produce:
|
||||
<div>
|
||||
<i>a</i>, <i>b</i>, <i>c</i>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
Previously, this macro could not be used inside <b>BOOST_PP_FOR</b>.
|
||||
There is no longer any such restriction.
|
||||
It is more efficient, however, to use <b>BOOST_PP_LIST_ENUM_R</b> in such a situation.
|
||||
</div>
|
||||
<h4>See Also</h4>
|
||||
<ul>
|
||||
<li><a href="list_enum_r.html">BOOST_PP_LIST_ENUM_R</a></li>
|
||||
</ul>
|
||||
<h4>Requirements</h4>
|
||||
<div>
|
||||
<b>Header:</b> <a href="../headers/list/enum.hpp.html"><boost/preprocessor/list/enum.hpp></a>
|
||||
</div>
|
||||
<h4><a class="local" onclick="toggle('sample');" onmouseover="change(this);" onmouseout="revert(this);">Sample Code</a></h4>
|
||||
<div id="sample"><pre>
|
||||
#include <boost/preprocessor/list/enum.hpp>
|
||||
|
||||
#define LIST (w, (x, (y, (z, BOOST_PP_NIL))))
|
||||
|
||||
BOOST_PP_LIST_ENUM(LIST) // expands to w, x, y, z
|
||||
<pre></div>
|
||||
</body>
|
||||
</html>
|
59
docs.1/ref/list_enum_r.html
Normal file
59
docs.1/ref/list_enum_r.html
Normal file
@ -0,0 +1,59 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>BOOST_PP_LIST_ENUM_R</title>
|
||||
<link rel="stylesheet" type="text/css" href="../styles.css">
|
||||
<script language="javascript" type="text/javascript" src="../scripts.js"></script>
|
||||
</head>
|
||||
<body onload="init('sample');">
|
||||
<div style="margin-left: 0px;">
|
||||
The <b>BOOST_PP_LIST_ENUM_R</b> macro converts a <i>list</i> to a comma-separated list.
|
||||
It reenters <b>BOOST_PP_FOR</b> with maximum efficiency.
|
||||
</div>
|
||||
<h4>Usage</h4>
|
||||
<div class="code">
|
||||
<b>BOOST_PP_LIST_ENUM_R</b>(<i>r</i>, <i>list</i>)
|
||||
</div>
|
||||
<h4>Arguments</h4>
|
||||
<dl>
|
||||
<dt>r</dt>
|
||||
<dd>
|
||||
The next available <b>BOOST_PP_FOR</b> repetition.
|
||||
</dd>
|
||||
<dt>list</dt>
|
||||
<dd>
|
||||
The <i>list</i> to be converted.
|
||||
</dd>
|
||||
</dl>
|
||||
<h4>Remarks</h4>
|
||||
<div>
|
||||
If <i>list</i> is, for example, (<i>a</i>, (<i>b</i>, (<i>c</i>, <b>BOOST_PP_NIL</b>))),
|
||||
this macro will produce:
|
||||
<div>
|
||||
<i>a</i>, <i>b</i>, <i>c</i>
|
||||
</div>
|
||||
</div>
|
||||
<h4>See Also</h4>
|
||||
<ul>
|
||||
<li><a href="list_enum.html">BOOST_PP_LIST_ENUM</a></li>
|
||||
</ul>
|
||||
<h4>Requirements</h4>
|
||||
<div>
|
||||
<b>Header:</b> <a href="../headers/list/enum.hpp.html"><boost/preprocessor/list/enum.hpp></a>
|
||||
</div>
|
||||
<h4><a class="local" onclick="toggle('sample');" onmouseover="change(this);" onmouseout="revert(this);">Sample Code</a></h4>
|
||||
<div id="sample"><pre>
|
||||
#include <boost/preprocessor/list/adt.hpp>
|
||||
#include <boost/preprocessor/repetition/for.hpp>
|
||||
#include <boost/preprocessor/list/enum.hpp>
|
||||
|
||||
#define LIST (x, (y, (z, BOOST_PP_NIL)))
|
||||
|
||||
#define PRED(r, state) BOOST_PP_LIST_IS_CONS(state)
|
||||
#define OP(r, state) BOOST_PP_LIST_REST(state)
|
||||
#define MACRO(r, state) [ BOOST_PP_LIST_ENUM_R(r, state) ]
|
||||
|
||||
BOOST_PP_FOR(LIST, PRED, OP, MACRO)
|
||||
// expands to [x, y, z] [y, z] [z]
|
||||
<pre></div>
|
||||
</body>
|
||||
</html>
|
65
docs.1/ref/list_filter.html
Normal file
65
docs.1/ref/list_filter.html
Normal file
@ -0,0 +1,65 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>BOOST_PP_LIST_FILTER</title>
|
||||
<link rel="stylesheet" type="text/css" href="../styles.css">
|
||||
<script language="javascript" type="text/javascript" src="../scripts.js"></script>
|
||||
</head>
|
||||
<body onload="init('sample');">
|
||||
<div style="margin-left: 0px;">
|
||||
The <b>BOOST_PP_LIST_FILTER</b> macro filters a <i>list</i> according to a supplied criterion.
|
||||
</div>
|
||||
<h4>Usage</h4>
|
||||
<div class="code">
|
||||
<b>BOOST_PP_LIST_FILTER</b>(<i>pred</i>, <i>data</i>, <i>list</i>)
|
||||
</div>
|
||||
<h4>Arguments</h4>
|
||||
<dl>
|
||||
<dt>pred</dt>
|
||||
<dd>
|
||||
A ternary predicate of the form <i>pred</i>(<i>d</i>, <i>data</i>, <i>elem</i>).
|
||||
This predicate is expanded by <b>BOOST_PP_LIST_FILTER</b> for each element in <i>list</i> with the next available <b>BOOST_PP_WHILE</b> iteration,
|
||||
the auxiliary <i>data</i>, and the current element in <i>list</i>.
|
||||
This macro must return a integral value in the range of <i>0</i> to <b>BOOST_PP_LIMIT_MAG</b>.
|
||||
If this predicate expands to non-zero for a certain element, that element is included in the resulting <i>list</i>.
|
||||
</dd>
|
||||
<dt>data</dt>
|
||||
<dd>
|
||||
Auxiliary data passed to <i>pred</i>.
|
||||
</dd>
|
||||
<dt>list</dt>
|
||||
<dd>
|
||||
The <i>list</i> to be filtered.
|
||||
</dd>
|
||||
</dl>
|
||||
<h4>Remarks</h4>
|
||||
<div>
|
||||
This macro expands <i>pred</i> for each element in <i>list</i>.
|
||||
It builds a new <i>list</i> out of each element for which <i>pred</i> returns non-zero.
|
||||
</div>
|
||||
<div>
|
||||
Previously, this macro could not be used inside <b>BOOST_PP_WHILE</b>.
|
||||
There is no longer any such restriction.
|
||||
It is more efficient, however, to use <b>BOOST_PP_LIST_FILTER_D</b> in such a situation.
|
||||
</div>
|
||||
<h4>See Also</h4>
|
||||
<ul>
|
||||
<li><a href="limit_mag.html">BOOST_PP_LIMIT_MAG</a></li>
|
||||
<li><a href="list_filter_d.html">BOOST_PP_LIST_FILTER_D</a></li>
|
||||
</ul>
|
||||
<h4>Requirements</h4>
|
||||
<div>
|
||||
<b>Header:</b> <a href="../headers/list/filter.hpp.html"><boost/preprocessor/list/filter.hpp></a>
|
||||
</div>
|
||||
<h4><a class="local" onclick="toggle('sample');" onmouseover="change(this);" onmouseout="revert(this);">Sample Code</a></h4>
|
||||
<div id="sample"><pre>
|
||||
#include <boost/preprocessor/comparison/less_equal.hpp>
|
||||
#include <boost/preprocessor/list/filter.hpp>
|
||||
|
||||
#define LIST (1, (3, (2, (5, BOOST_PP_NIL))))
|
||||
|
||||
#define PRED(d, data, elem) BOOST_PP_LESS_EQUAL(elem, data)
|
||||
|
||||
BOOST_PP_LIST_FILTER(PRED, 3, LIST) // expands to (1, (3, (2, BOOST_PP_NIL)))
|
||||
<pre></div>
|
||||
</body>
|
||||
</html>
|
76
docs.1/ref/list_filter_d.html
Normal file
76
docs.1/ref/list_filter_d.html
Normal file
@ -0,0 +1,76 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>BOOST_PP_LIST_FILTER_D</title>
|
||||
<link rel="stylesheet" type="text/css" href="../styles.css">
|
||||
<script language="javascript" type="text/javascript" src="../scripts.js"></script>
|
||||
</head>
|
||||
<body onload="init('sample');">
|
||||
<div style="margin-left: 0px;">
|
||||
The <b>BOOST_PP_LIST_FILTER_D</b> macro filters a <i>list</i> according to a supplied criterion.
|
||||
It reenters <b>BOOST_PP_WHILE</b> with maximum efficiency.
|
||||
</div>
|
||||
<h4>Usage</h4>
|
||||
<div class="code">
|
||||
<b>BOOST_PP_LIST_FILTER_D</b>(<i>d</i>, <i>pred</i>, <i>data</i>, <i>list</i>)
|
||||
</div>
|
||||
<h4>Arguments</h4>
|
||||
<dl>
|
||||
<dt>d</dt>
|
||||
<dd>
|
||||
The next available <b>BOOST_PP_WHILE</b> iteration.
|
||||
</dd>
|
||||
<dt>pred</dt>
|
||||
<dd>
|
||||
A ternary predicate of the form <i>pred</i>(<i>d</i>, <i>data</i>, <i>elem</i>).
|
||||
This predicate is expanded by <b>BOOST_PP_LIST_FILTER</b> for each element in <i>list</i> with the next available <b>BOOST_PP_WHILE</b> iteration,
|
||||
the auxiliary <i>data</i>, and the current element in <i>list</i>.
|
||||
This macro must return a integral value in the range of <i>0</i> to <b>BOOST_PP_LIMIT_MAG</b>.
|
||||
If this predicate expands to non-zero for a certain element, that element is included in the resulting <i>list</i>.
|
||||
</dd>
|
||||
<dt>data</dt>
|
||||
<dd>
|
||||
Auxiliary data passed to <i>pred</i>.
|
||||
</dd>
|
||||
<dt>list</dt>
|
||||
<dd>
|
||||
The <i>list</i> to be filtered.
|
||||
</dd>
|
||||
</dl>
|
||||
<h4>Remarks</h4>
|
||||
<div>
|
||||
This macro expands <i>pred</i> for each element in <i>list</i>.
|
||||
It builds a new <i>list</i> out of each element for which <i>pred</i> returns non-zero.
|
||||
</div>
|
||||
<h4>See Also</h4>
|
||||
<ul>
|
||||
<li><a href="limit_mag.html">BOOST_PP_LIMIT_MAG</a></li>
|
||||
<li><a href="list_filter_d.html">BOOST_PP_LIST_FILTER_D</a></li>
|
||||
</ul>
|
||||
<h4>Requirements</h4>
|
||||
<div>
|
||||
<b>Header:</b> <a href="../headers/list/filter.hpp.html"><boost/preprocessor/list/filter.hpp></a>
|
||||
</div>
|
||||
<h4><a class="local" onclick="toggle('sample');" onmouseover="change(this);" onmouseout="revert(this);">Sample Code</a></h4>
|
||||
<div id="sample"><pre>
|
||||
#include <boost/preprocessor/comparison/less_equal.hpp>
|
||||
#include <boost/preprocessor/list/filter.hpp>
|
||||
#include <boost/preprocessor/list/fold_right.hpp>
|
||||
|
||||
#define A (1, (2, (3, (4, BOOST_PP_NIL))))
|
||||
#define B (A, (A, (A, (A, BOOST_PP_NIL))))
|
||||
|
||||
#define PRED(d, data, x) BOOST_PP_LESS_EQUAL(x, data)
|
||||
#define OP(d, state, x) (BOOST_PP_LIST_FILTER_D(d, PRED, 2, x), state)
|
||||
|
||||
BOOST_PP_LIST_FOLD_RIGHT(OP, BOOST_PP_NIL, B)
|
||||
/*
|
||||
expands to:
|
||||
((1, (2, BOOST_PP_NIL)),
|
||||
((1, (2, BOOST_PP_NIL)),
|
||||
((1, (2, BOOST_PP_NIL)),
|
||||
((1, (2, BOOST_PP_NIL)),
|
||||
BOOST_PP_NIL))))
|
||||
*/
|
||||
<pre></div>
|
||||
</body>
|
||||
</html>
|
52
docs.1/ref/list_first.html
Normal file
52
docs.1/ref/list_first.html
Normal file
@ -0,0 +1,52 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>BOOST_PP_LIST_FIRST</title>
|
||||
<link rel="stylesheet" type="text/css" href="../styles.css">
|
||||
<script language="javascript" type="text/javascript" src="../scripts.js"></script>
|
||||
</head>
|
||||
<body onload="init('sample');">
|
||||
<div style="margin-left: 0px;">
|
||||
The <b>BOOST_PP_LIST_FIRST</b> macro expands to the head of a <i>list</i>.
|
||||
</div>
|
||||
<h4>Usage</h4>
|
||||
<div class="code">
|
||||
<b>BOOST_PP_LIST_FIRST</b>(<i>list</i>)
|
||||
</div>
|
||||
<h4>Arguments</h4>
|
||||
<dl>
|
||||
<dt>list</dt>
|
||||
<dd>
|
||||
A non-nil <i>list</i>.
|
||||
</dd>
|
||||
</dl>
|
||||
<h4>Requirements</h4>
|
||||
<div>
|
||||
<b>Header:</b> <a href="../headers/list/adt.hpp.html"><boost/preprocessor/list/adt.hpp></a>
|
||||
</div>
|
||||
<h4><a class="local" onclick="toggle('sample');" onmouseover="change(this);" onmouseout="revert(this);">Sample Code</a></h4>
|
||||
<div id="sample"><pre>
|
||||
#include <boost/preprocessor/list/adt.hpp>
|
||||
|
||||
#define OLD /* ........... */ \
|
||||
BOOST_PP_LIST_CONS( \
|
||||
a, \
|
||||
BOOST_PP_LIST_CONS( \
|
||||
b, \
|
||||
BOOST_PP_LIST_CONS( \
|
||||
c, \
|
||||
BOOST_PP_LIST_NIL \
|
||||
) \
|
||||
) \
|
||||
) \
|
||||
/**/
|
||||
|
||||
#define NEW (a, (b, (c, BOOST_PP_NIL)))
|
||||
|
||||
BOOST_PP_LIST_FIRST(OLD) == BOOST_PP_LIST_FIRST(NEW)
|
||||
// expands to a == a
|
||||
|
||||
BOOST_PP_LIST_REST(OLD) == BOOST_PP_LIST_REST(NEW)
|
||||
// expands to (b, (c, BOOST_PP_NIL)) == (b, (c, BOOST_PP_NIL))
|
||||
<pre></div>
|
||||
</body>
|
||||
</html>
|
52
docs.1/ref/list_first_n.html
Normal file
52
docs.1/ref/list_first_n.html
Normal file
@ -0,0 +1,52 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>BOOST_PP_LIST_FIRST_N</title>
|
||||
<link rel="stylesheet" type="text/css" href="../styles.css">
|
||||
<script language="javascript" type="text/javascript" src="../scripts.js"></script>
|
||||
</head>
|
||||
<body onload="init('sample');">
|
||||
<div style="margin-left: 0px;">
|
||||
The <b>BOOST_PP_LIST_FIRST_N</b> macro expands to a <i>list</i> of the first <i>count</i> elements of a <i>list</i>.
|
||||
</div>
|
||||
<h4>Usage</h4>
|
||||
<div class="code">
|
||||
<b>BOOST_PP_LIST_FIRST_N</b>(<i>count</i>, <i>list</i>)
|
||||
</div>
|
||||
<h4>Arguments</h4>
|
||||
<dl>
|
||||
<dt>count</dt>
|
||||
<dd>
|
||||
The number of elements to extract.
|
||||
</dd>
|
||||
<dt>list</dt>
|
||||
<dd>
|
||||
The <i>list</i> from which the elements are extracted.
|
||||
</dd>
|
||||
</dl>
|
||||
<h4>Remarks</h4>
|
||||
<div>
|
||||
This macro extracts <i>count</i> elements from the beginning of <i>list</i> and returns them as a <i>list</i>
|
||||
</div>
|
||||
<div>
|
||||
Previously, this macro could not be used inside <b>BOOST_PP_WHILE</b>.
|
||||
There is no longer any such restriction.
|
||||
It is more efficient, however, to use <b>BOOST_PP_LIST_FIRST_N_D</b> in such a situation.
|
||||
</div>
|
||||
<h4>See Also</h4>
|
||||
<ul>
|
||||
<li><a href="list_first_n_d.html">BOOST_PP_LIST_FIRST_N_D</a></li>
|
||||
</ul>
|
||||
<h4>Requirements</h4>
|
||||
<div>
|
||||
<b>Header:</b> <a href="../headers/list/first_n.hpp.html"><boost/preprocessor/list/first_n.hpp></a>
|
||||
</div>
|
||||
<h4><a class="local" onclick="toggle('sample');" onmouseover="change(this);" onmouseout="revert(this);">Sample Code</a></h4>
|
||||
<div id="sample"><pre>
|
||||
#include <boost/preprocessor/list/first_n.hpp>
|
||||
|
||||
#define LIST (a, (b, (c, BOOST_PP_NIL)))
|
||||
|
||||
BOOST_PP_LIST_FIRST_N(2, LIST) // expands to (a, (b, BOOST_PP_NIL))
|
||||
<pre></div>
|
||||
</body>
|
||||
</html>
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user