forked from boostorg/preprocessor
Docs update
[SVN r13144]
This commit is contained in:
@ -28,7 +28,10 @@
|
||||
|
||||
<h2><a name="BOOST_PP_ASSERT_MSG">#define BOOST_PP_ASSERT_MSG</a>(C,MSG)</h2>
|
||||
<p>Expands to nothing if <code>C != 0</code> and to <code>MSG</code> if
|
||||
<code>C == 0</code>.</p>
|
||||
<code>C == 0</code>.</p>
|
||||
|
||||
<p>For example, <code><a href="assert_msg.htm#BOOST_PP_ASSERT_MSG">BOOST_PP_ASSERT_MSG</a>(1,A BUG!)</code> expands to <code>A BUG!</code>.</p>
|
||||
|
||||
<hr>
|
||||
|
||||
<h2><a name="BOOST_PREPROCESSOR_ASSERT_MSG">#define BOOST_PREPROCESSOR_ASSERT_MSG</a>(C,MSG)</h2>
|
||||
|
@ -30,6 +30,8 @@
|
||||
<p>Concatenates <code>X</code> and <code>Y</code> after they are macro
|
||||
expanded.</p>
|
||||
|
||||
<p>For example, <code><a href="cat.htm#BOOST_PP_CAT">BOOST_PP_CAT</a>(A,<a href="cat.htm#BOOST_PP_CAT">BOOST_PP_CAT</a>(_,B))</code> expands to <code>A_B</code>.</p>
|
||||
|
||||
<h3>Example</h3>
|
||||
<ul>
|
||||
<li><a href="../../example/static_assert.c">static_assert.c</a></li>
|
||||
|
@ -27,7 +27,18 @@
|
||||
<hr>
|
||||
|
||||
<h2><a name="BOOST_PP_COMMA">#define BOOST_PP_COMMA</a>()</h2>
|
||||
<p>Expands to a comma. Can be used with <a href="if.htm#BOOST_PP_IF">BOOST_PP_IF</a>().</p>
|
||||
<p>Expands to a comma.</p>
|
||||
|
||||
<p>Commas need special handling in preprocessor code, because commas are used
|
||||
for separating macro parameters.</p>
|
||||
|
||||
<p>For example,</p>
|
||||
|
||||
<pre>
|
||||
<a href="if.htm#BOOST_PP_IF">BOOST_PP_IF</a>(1,<a href="comma.htm#BOOST_PP_COMMA">BOOST_PP_COMMA</a>,<a href="empty.htm#BOOST_PP_EMPTY">BOOST_PP_EMPTY</a>)()
|
||||
</pre>
|
||||
|
||||
<p>expands to a comma.</p>
|
||||
|
||||
<h3>See</h3>
|
||||
<ul>
|
||||
|
@ -30,6 +30,8 @@
|
||||
<p>Expands to a comma if <code>C != 0</code> and nothing if
|
||||
<code>C == 0</code>.</p>
|
||||
|
||||
<p>For example, <code><a href="comma_if.htm#BOOST_PP_COMMA_IF">BOOST_PP_COMMA_IF</a>(0)</code> expands to nothing.</p>
|
||||
|
||||
<hr>
|
||||
|
||||
<h2><a name="BOOST_PREPROCESSOR_COMMA_IF">#define BOOST_PREPROCESSOR_COMMA_IF</a>(C)</h2>
|
||||
|
@ -30,6 +30,8 @@
|
||||
<p>Expands to <code>1</code> if <code>X == Y</code> and <code>0</code>
|
||||
otherwise.</p>
|
||||
|
||||
<p>For example, <code><a href="comparison_equal.htm#BOOST_PP_EQUAL">BOOST_PP_EQUAL</a>(4,4)</code> expands to <code>1</code>.</p>
|
||||
|
||||
<h3>Uses</h3>
|
||||
<ul>
|
||||
<li><a href="while.htm#BOOST_PP_WHILE">BOOST_PP_WHILE</a>()</li>
|
||||
|
@ -30,6 +30,8 @@
|
||||
<p>Expands to <code>1</code> if <code>X > Y</code> and <code>0</code>
|
||||
otherwise.</p>
|
||||
|
||||
<p>For example, <code><a href="comparison_greater.htm#BOOST_PP_GREATER">BOOST_PP_GREATER</a>(4,3)</code> expands to <code>1</code>.</p>
|
||||
|
||||
<h3>Uses</h3>
|
||||
<ul>
|
||||
<li><a href="while.htm#BOOST_PP_WHILE">BOOST_PP_WHILE</a>()</li>
|
||||
|
@ -30,6 +30,8 @@
|
||||
<p>Expands to <code>1</code> if <code>X >= Y</code> and <code>0</code>
|
||||
otherwise.</p>
|
||||
|
||||
<p>For example, <code><a href="comparison_greater_equal.htm#BOOST_PP_GREATER_EQUAL">BOOST_PP_GREATER_EQUAL</a>(1,3)</code> expands to <code>0</code>.</p>
|
||||
|
||||
<h3>Uses</h3>
|
||||
<ul>
|
||||
<li><a href="while.htm#BOOST_PP_WHILE">BOOST_PP_WHILE</a>()</li>
|
||||
|
@ -30,6 +30,8 @@
|
||||
<p>Expands to <code>1</code> if <code>X < Y</code> and <code>0</code>
|
||||
otherwise.</p>
|
||||
|
||||
<p>For example, <code><a href="comparison_less.htm#BOOST_PP_LESS">BOOST_PP_LESS</a>(2,6)</code> expands to <code>1</code>.</p>
|
||||
|
||||
<h3>Uses</h3>
|
||||
<ul>
|
||||
<li><a href="while.htm#BOOST_PP_WHILE">BOOST_PP_WHILE</a>()</li>
|
||||
|
@ -30,6 +30,8 @@
|
||||
<p>Expands to <code>1</code> if <code>X <= Y</code> and <code>0</code>
|
||||
otherwise.</p>
|
||||
|
||||
<p>For example, <code><a href="comparison_less_equal.htm#BOOST_PP_LESS_EQUAL">BOOST_PP_LESS_EQUAL</a>(7,5)</code> expands to <code>0</code>.</p>
|
||||
|
||||
<h3>Uses</h3>
|
||||
<ul>
|
||||
<li><a href="while.htm#BOOST_PP_WHILE">BOOST_PP_WHILE</a>()</li>
|
||||
|
@ -30,6 +30,8 @@
|
||||
<p>Expands to <code>1</code> if <code>X != Y</code> and <code>0</code>
|
||||
otherwise.</p>
|
||||
|
||||
<p>For example, <code><a href="comparison_not_equal.htm#BOOST_PP_NOT_EQUAL">BOOST_PP_NOT_EQUAL</a>(4,4)</code> expands to <code>0</code>.</p>
|
||||
|
||||
<h3>Uses</h3>
|
||||
<ul>
|
||||
<li><a href="while.htm#BOOST_PP_WHILE">BOOST_PP_WHILE</a>()</li>
|
||||
|
@ -27,7 +27,15 @@
|
||||
<hr>
|
||||
|
||||
<h2><a name="BOOST_PP_EMPTY">#define BOOST_PP_EMPTY</a>()</h2>
|
||||
<p>Expands to nothing. Used with <a href="if.htm#BOOST_PP_IF">BOOST_PP_IF</a>() and as an unused parameter.</p>
|
||||
<p>Expands to nothing.</p>
|
||||
|
||||
<p>For example,</p>
|
||||
|
||||
<pre>
|
||||
<a href="if.htm#BOOST_PP_IF">BOOST_PP_IF</a>(0,<a href="comma.htm#BOOST_PP_COMMA">BOOST_PP_COMMA</a>,<a href="empty.htm#BOOST_PP_EMPTY">BOOST_PP_EMPTY</a>)()
|
||||
</pre>
|
||||
|
||||
<p>expands to nothing.</p>
|
||||
|
||||
<h3>Example</h3>
|
||||
<ul>
|
||||
|
@ -35,6 +35,20 @@
|
||||
F(0,P), F(1,P), ..., F(<a href="dec.htm#BOOST_PP_DEC">BOOST_PP_DEC</a>(N),P)
|
||||
</pre>
|
||||
|
||||
<p>For example,</p>
|
||||
|
||||
<pre>
|
||||
#define TYPED_PARAM(I,P)\
|
||||
<a href="cat.htm#BOOST_PP_CAT">BOOST_PP_CAT</a>(<a href="tuple_elem.htm#BOOST_PP_TUPLE_ELEM">BOOST_PP_TUPLE_ELEM</a>(2,0,P),I) <a href="cat.htm#BOOST_PP_CAT">BOOST_PP_CAT</a>(<a href="tuple_elem.htm#BOOST_PP_TUPLE_ELEM">BOOST_PP_TUPLE_ELEM</a>(2,1,P),I)
|
||||
<a href="enum.htm#BOOST_PP_ENUM">BOOST_PP_ENUM</a>(3,TYPED_PARAM,(X,x))
|
||||
</pre>
|
||||
|
||||
<p>expands to:</p>
|
||||
|
||||
<pre>
|
||||
X0 x0, X1 x1, X2 x2
|
||||
</pre>
|
||||
|
||||
<h3>Uses</h3>
|
||||
<ul>
|
||||
<li><a href="repeat.htm#BOOST_PP_REPEAT">BOOST_PP_REPEAT</a>()</li>
|
||||
|
@ -35,6 +35,18 @@
|
||||
<a href="cat.htm#BOOST_PP_CAT">BOOST_PP_CAT</a>(P,0), <a href="cat.htm#BOOST_PP_CAT">BOOST_PP_CAT</a>(P,1), ..., <a href="cat.htm#BOOST_PP_CAT">BOOST_PP_CAT</a>(P,<a href="dec.htm#BOOST_PP_DEC">BOOST_PP_DEC</a>(N))
|
||||
</pre>
|
||||
|
||||
<p>For example,</p>
|
||||
|
||||
<pre>
|
||||
<a href="enum_params.htm#BOOST_PP_ENUM_PARAMS">BOOST_PP_ENUM_PARAMS</a>(3,x)
|
||||
</pre>
|
||||
|
||||
<p>expands to:</p>
|
||||
|
||||
<pre>
|
||||
x0, x1, x2
|
||||
</pre>
|
||||
|
||||
<h3>Uses</h3>
|
||||
<ul>
|
||||
<li><a href="repeat.htm#BOOST_PP_REPEAT">BOOST_PP_REPEAT</a>()</li>
|
||||
|
@ -35,6 +35,18 @@
|
||||
<a href="cat.htm#BOOST_PP_CAT">BOOST_PP_CAT</a>(P,0) = D, <a href="cat.htm#BOOST_PP_CAT">BOOST_PP_CAT</a>(P,1) = D, ..., <a href="cat.htm#BOOST_PP_CAT">BOOST_PP_CAT</a>(P,<a href="dec.htm#BOOST_PP_DEC">BOOST_PP_DEC</a>(N)) = D
|
||||
</pre>
|
||||
|
||||
<p>For example,</p>
|
||||
|
||||
<pre>
|
||||
<a href="enum_params_with_a_default.htm#BOOST_PP_ENUM_PARAMS_WITH_A_DEFAULT">BOOST_PP_ENUM_PARAMS_WITH_A_DEFAULT</a>(3,x,y)
|
||||
</pre>
|
||||
|
||||
<p>expands to:</p>
|
||||
|
||||
<pre>
|
||||
x0 = y, x1 = y, x2 = y
|
||||
</pre>
|
||||
|
||||
<h3>Uses</h3>
|
||||
<ul>
|
||||
<li><a href="repeat.htm#BOOST_PP_REPEAT">BOOST_PP_REPEAT</a>()</li>
|
||||
|
@ -38,6 +38,18 @@
|
||||
<a href="cat.htm#BOOST_PP_CAT">BOOST_PP_CAT</a>(P,<a href="dec.htm#BOOST_PP_DEC">BOOST_PP_DEC</a>(N)) = <a href="cat.htm#BOOST_PP_CAT">BOOST_PP_CAT</a>(D,<a href="dec.htm#BOOST_PP_DEC">BOOST_PP_DEC</a>(N))
|
||||
</pre>
|
||||
|
||||
<p>For example,</p>
|
||||
|
||||
<pre>
|
||||
<a href="enum_params_with_defaults.htm#BOOST_PP_ENUM_PARAMS_WITH_DEFAULTS">BOOST_PP_ENUM_PARAMS_WITH_DEFAULTS</a>(3,x,y)
|
||||
</pre>
|
||||
|
||||
<p>expands to:</p>
|
||||
|
||||
<pre>
|
||||
x0 = y0, x1 = y1, x2 = y2
|
||||
</pre>
|
||||
|
||||
<h3>Uses</h3>
|
||||
<ul>
|
||||
<li><a href="repeat.htm#BOOST_PP_REPEAT">BOOST_PP_REPEAT</a>()</li>
|
||||
|
@ -35,6 +35,20 @@
|
||||
F(1,P), F(2,P), ..., F(<a href="dec.htm#BOOST_PP_DEC">BOOST_PP_DEC</a>(N),P)
|
||||
</pre>
|
||||
|
||||
<p>For example,</p>
|
||||
|
||||
<pre>
|
||||
#define TYPED_PARAM(I,P)\
|
||||
<a href="cat.htm#BOOST_PP_CAT">BOOST_PP_CAT</a>(<a href="tuple_elem.htm#BOOST_PP_TUPLE_ELEM">BOOST_PP_TUPLE_ELEM</a>(2,0,P),I) <a href="cat.htm#BOOST_PP_CAT">BOOST_PP_CAT</a>(<a href="tuple_elem.htm#BOOST_PP_TUPLE_ELEM">BOOST_PP_TUPLE_ELEM</a>(2,1,P),I)
|
||||
<a href="enum_shifted.htm#BOOST_PP_ENUM_SHIFTED">BOOST_PP_ENUM_SHIFTED</a>(3,TYPED_PARAM,(X,x))
|
||||
</pre>
|
||||
|
||||
<p>expands to:</p>
|
||||
|
||||
<pre>
|
||||
X1 x1, X2 x2
|
||||
</pre>
|
||||
|
||||
<h3>Uses</h3>
|
||||
<ul>
|
||||
<li><a href="repeat.htm#BOOST_PP_REPEAT">BOOST_PP_REPEAT</a>()</li>
|
||||
|
@ -34,6 +34,17 @@
|
||||
<pre>
|
||||
<a href="cat.htm#BOOST_PP_CAT">BOOST_PP_CAT</a>(P,1), <a href="cat.htm#BOOST_PP_CAT">BOOST_PP_CAT</a>(P,2), ..., <a href="cat.htm#BOOST_PP_CAT">BOOST_PP_CAT</a>(P,<a href="dec.htm#BOOST_PP_DEC">BOOST_PP_DEC</a>(N))
|
||||
</pre>
|
||||
<p>For example,</p>
|
||||
|
||||
<pre>
|
||||
<a href="enum_shifted_params.htm#BOOST_PP_ENUM_SHIFTED_PARAMS">BOOST_PP_ENUM_SHIFTED_PARAMS</a>(3,x)
|
||||
</pre>
|
||||
|
||||
<p>expands to:</p>
|
||||
|
||||
<pre>
|
||||
x1, x2
|
||||
</pre>
|
||||
|
||||
<h3>Uses</h3>
|
||||
<ul>
|
||||
|
@ -55,6 +55,21 @@
|
||||
by the C++ preprocessor.</li>
|
||||
</ul>
|
||||
|
||||
<p>For example,</p>
|
||||
|
||||
<pre>
|
||||
#define C(R,X) <a href="comparison_less.htm#BOOST_PP_LESS">BOOST_PP_LESS</a>(<a href="tuple_elem.htm#BOOST_PP_TUPLE_ELEM">BOOST_PP_TUPLE_ELEM</a>(2,0,X),<a href="tuple_elem.htm#BOOST_PP_TUPLE_ELEM">BOOST_PP_TUPLE_ELEM</a>(2,1,X))
|
||||
#define F(R,X) (<a href="inc.htm#BOOST_PP_INC">BOOST_PP_INC</a>(<a href="tuple_elem.htm#BOOST_PP_TUPLE_ELEM">BOOST_PP_TUPLE_ELEM</a>(2,0,X)),<a href="tuple_elem.htm#BOOST_PP_TUPLE_ELEM">BOOST_PP_TUPLE_ELEM</a>(2,1,X))
|
||||
#define I(R,X) <a href="tuple_elem.htm#BOOST_PP_TUPLE_ELEM">BOOST_PP_TUPLE_ELEM</a>(2,0,X)
|
||||
<a href="for.htm#BOOST_PP_FOR">BOOST_PP_FOR</a>((0,3),C,F,I)
|
||||
</pre>
|
||||
|
||||
<p>expands to:</p>
|
||||
|
||||
<pre>
|
||||
0 1 2
|
||||
</pre>
|
||||
|
||||
<h3><a href="repeat.htm#BOOST_PP_REPEAT">BOOST_PP_REPEAT</a>() vs <a href="for.htm#BOOST_PP_FOR">BOOST_PP_FOR</a>()</h3>
|
||||
|
||||
<p><a href="for.htm#BOOST_PP_FOR">BOOST_PP_FOR</a>() is a generalization of <a href="repeat.htm#BOOST_PP_REPEAT">BOOST_PP_REPEAT</a>(). This means that
|
||||
|
@ -29,6 +29,8 @@
|
||||
<h2><a name="BOOST_PP_IF_THEN">#define BOOST_PP_IF_THEN</a>(C,T)</h2>
|
||||
<p>Expands to <code>T</code> if <code>C != 0</code> and to nothing if <code>C == 0</code>.</p>
|
||||
|
||||
<p>For example, <code><a href="if_then.htm#BOOST_PP_IF_THEN">BOOST_PP_IF_THEN</a>(1,^)</code> expands to <code>^</code>.</p>
|
||||
|
||||
<hr>
|
||||
|
||||
<a href="if.htm">Prev</a> <a href="inc.htm">Next</a> <a href="index.htm#Macros">Macros</a> <a href="index.htm#Headers">Headers</a>
|
||||
|
Reference in New Issue
Block a user