1 #ifndef BOOST_PREPROCESSOR_EXPR_IF_HPP
2 #define BOOST_PREPROCESSOR_EXPR_IF_HPP
6 * http://www.housemarque.com
8 * Permission to copy, use, modify, sell and distribute this software is
9 * granted provided this copyright notice appears in all copies. This
10 * software is provided "as is" without express or implied warranty, and
11 * with no claim as to its suitability for any purpose.
13 * See http://www.boost.org for most recent version.
16 #include <boost/preprocessor/detail/cat.hpp>
17 #include <boost/preprocessor/logical/bool.hpp>
19 /** <p>Expands to <code>EXPR</code> if <code>COND != 0</code> and to nothing if <code>COND == 0</code>.</p>
21 <p><code>COND</code> must expand to an integer literal in the range [0, BOOST_PP_LIMIT_MAG].</p>
23 <p>For example, <code>BOOST_PP_EXPR_IF(1,^)</code> expands to <code>^</code>.</p>
27 <li>BOOST_PP_IF()</li>
30 #define BOOST_PP_EXPR_IF(COND,EXPR) BOOST_PP_DETAIL_CAT2(BOOST_PP_EXPR_IF,BOOST_PP_BOOL(COND))(EXPR)
32 #define BOOST_PP_EXPR_IF0(E)
33 #define BOOST_PP_EXPR_IF1(E) E