]> git.lyx.org Git - lyx.git/blob - boost/boost/preprocessor/if.hpp
update
[lyx.git] / boost / boost / preprocessor / if.hpp
1 #ifndef BOOST_PREPROCESSOR_IF_HPP
2 #define BOOST_PREPROCESSOR_IF_HPP
3
4 /* Copyright (C) 2001
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/detail/cat.hpp>
17 #include <boost/preprocessor/logical/bool.hpp>
18
19 /** <p>Expands to <code>THEN</code> if <code>COND != 0</code> and <code>ELSE</code> if
20 <code>COND == 0</code>.</p>
21
22 <p><code>COND</code> must expand to an integer literal in the range [0, BOOST_PP_LIMIT_MAG].</p>
23
24 <p>For example, <code>BOOST_PP_IF(0,1,2)</code> expands to <code>2</code>.</p>
25
26 <h3>See</h3>
27 <ul>
28   <li>BOOST_PP_EXPR_IF()</li>
29 </ul>
30
31 <h3>Test</h3>
32 <ul>
33   <li><a href="../../test/preprocessor_test.cpp">preprocessor_test.cpp</a></li>
34 </ul>
35 */
36 #define BOOST_PP_IF(COND,THEN,ELSE) BOOST_PP_DETAIL_CAT2(BOOST_PP_IF,BOOST_PP_BOOL(COND))(ELSE,THEN)
37 #define BOOST_PP_IF0(E,T) E
38 #define BOOST_PP_IF1(E,T) T
39 #endif