###  | # Boost.Preprocessor ## Reference

Prev Next Macros Headers

# #include <boost/preprocessor/if.hpp>

## #define BOOST_PP_IF(COND,THEN,ELSE)

Expands to `THEN` if `COND != 0` and `ELSE` if `COND == 0`.

`COND` must expand to an integer literal in the range [0, BOOST_PP_LIMIT_MAG].

For example, `BOOST_PP_IF(0,1,2)` expands to `2`.

### See

- BOOST_PP_EXPR_IF()

### Test

- preprocessor_test.cpp

Prev Next Macros Headers

Revised

© Copyright Housemarque Oy 2002

Permission to copy, use, modify, sell and distribute this document is granted provided this copyright notice appears in all copies. This document is provided "as is" without express or implied warranty, and with no claim as to its suitability for any purpose.