3 <title>BOOST_PP_IIF
</title>
4 <link rel=
"stylesheet" type=
"text/css" href=
"../styles.css">
7 <div style=
"margin-left: 0px;">
8 The
<b>BOOST_PP_IIF
</b> macro chooses between to values based on a bitwise condition.
12 <b>BOOST_PP_IIF
</b>(
<i>bit
</i>,
<i>t
</i>,
<i>f
</i>)
18 The condition that determines if the result is
<i>expr
</i> or nothing.
19 This value must expand to
<i>0</i> or
<i>1</i>.
23 The result of the expansion if
<i>bit
</i> is
<i>1</i>.
27 The result of the expansion if
<i>bit
</i> is
<i>0</i>.
32 This macro
<i>does not
</i> perform a boolean conversion on its first argument.
33 If that conversion is necessary, use
<b>BOOST_PP_IF
</b> instead.
37 <li><a href=
"if.html">BOOST_PP_IF
</a></li>
38 <li><a href=
"limit_mag.html">BOOST_PP_LIMIT_MAG
</a></li>
42 <b>Header:
</b> <a href=
"../headers/control/iif.html"><boost/preprocessor/control/iif.hpp
></a>
46 #include
<<a href=
"../headers/control/iif.html">boost/preprocessor/control/iif.hpp
</a>>
47 #include
<<a href=
"../headers/logical/or.html">boost/preprocessor/logical/or.hpp
</a>>
49 #define OR_IF(p, q, t, f)
<a href=
"iif.html">BOOST_PP_IIF
</a>(
<a href=
"or.html">BOOST_PP_OR
</a>(p, q), t, f)
51 OR_IF(
1,
0, abc, xyz) // expands to abc
52 OR_IF(
0,
0, abc, xyz) // expands to xyz
55 <div style=
"margin-left: 0px;">
56 <i>© Copyright
<a href=
"http://www.housemarque.com" target=
"_top">Housemarque Oy
</a> 2002</i>
57 </br><i>© Copyright Paul Mensonides
2002</i>
59 <div style=
"margin-left: 0px;">
60 <p><small>Distributed under the Boost Software License, Version
1.0. (See
61 accompanying file
<a href=
"../../../../LICENSE_1_0.txt">LICENSE_1_0.txt
</a> or
63 "http://www.boost.org/LICENSE_1_0.txt">www.boost.org/LICENSE_1_0.txt
</a>)
</small></p>