forked from boostorg/preprocessor
55 lines
1.7 KiB
HTML
55 lines
1.7 KiB
HTML
<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>
|