]> git.lyx.org Git - lyx.git/blob - boost/boost/preprocessor/expr_if.hpp
major boost update
[lyx.git] / boost / boost / preprocessor / expr_if.hpp
1 #ifndef BOOST_PREPROCESSOR_EXPR_IF_HPP
2 #define BOOST_PREPROCESSOR_EXPR_IF_HPP
3
4 /* Copyright (C) 2002
5  * Housemarque Oy
6  * http://www.housemarque.com
7  *
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.
12  *
13  * See http://www.boost.org for most recent version.
14  */
15
16 #include <boost/preprocessor/logical/bool.hpp>
17
18 /** <p>Expands to <code>EXPR</code> if <code>COND != 0</code> and to nothing if <code>COND == 0</code>.</p>
19
20 <p><code>COND</code> must expand to an integer literal in the range [0, BOOST_PP_LIMIT_MAG].</p>
21
22 <p>For example, <code>BOOST_PP_EXPR_IF(1,^)</code> expands to <code>^</code>.</p>
23
24 <h3>See</h3>
25 <ul>
26   <li>BOOST_PP_IF()</li>
27 </ul>
28 */
29 #define BOOST_PP_EXPR_IF(COND,EXPR) BOOST_PP_EXPR_IF_BOOL(BOOST_PP_BOOL(COND))(EXPR)
30
31 #define BOOST_PP_EXPR_IF_BOOL(C) BOOST_PP_EXPR_IF_BOOL_DELAY(C)
32 #define BOOST_PP_EXPR_IF_BOOL_DELAY(C) BOOST_PP_EXPR_IF_BOOL##C
33 #define BOOST_PP_EXPR_IF_BOOL0(E)
34 #define BOOST_PP_EXPR_IF_BOOL1(E) E
35 #endif