forked from boostorg/preprocessor
Using private detail CAT to avoid DELAY macros
[SVN r14147]
This commit is contained in:
@ -13,18 +13,19 @@
|
||||
* See http://www.boost.org for most recent version.
|
||||
*/
|
||||
|
||||
#include <boost/preprocessor/detail/cat.hpp>
|
||||
|
||||
/** <p>Expands to <code>0</code> if <code>X == 0</code> and <code>1</code> if <code>X != 0</code>.</p>
|
||||
|
||||
<p><code>X</code> must be an integer literal in the range [0, BOOST_PP_LIMIT_MAG].</p>
|
||||
|
||||
<p>For example, <code>BOOST_PP_BOOL(3)</code> expands to <code>1</code>.</p>
|
||||
*/
|
||||
#define BOOST_PP_BOOL(X) BOOST_PP_BOOL_DELAY(X)
|
||||
#define BOOST_PP_BOOL(X) BOOST_PP_DETAIL_CAT2(BOOST_PP_BOOL,X)
|
||||
|
||||
/* BOOL can be implemented in O(1) tokens using saturated ADD & SUB.
|
||||
* Unfortunately, it would result in significantly slower preprocessing.
|
||||
*/
|
||||
#define BOOST_PP_BOOL_DELAY(X) BOOST_PP_BOOL##X
|
||||
#define BOOST_PP_BOOL0 0
|
||||
#define BOOST_PP_BOOL1 1
|
||||
#define BOOST_PP_BOOL2 1
|
||||
|
Reference in New Issue
Block a user