The BOOST_PP_COMPL macro performs a bitwise inversion (bitwise NOT or one's complement) on its operand.

Usage

BOOST_PP_COMPL(x)

Arguments

x
The value to be converted.  This value must expand to 0 or 1.

Remarks

If x is 0, this macro expands to 1.  If x is 1, this it expands to 0.
This macro does not perform a boolean conversion on its operand before performing the inversion OR operation.  If that conversion is necessary, use BOOST_PP_NOT instead.

See Also

Requirements

Header:  <boost/preprocessor/logical/compl.hpp>

Sample Code

#include <boost/preprocessor/logical/compl.hpp>

BOOST_PP_COMPL(1) // expands to 0
BOOST_PP_COMPL(0) // expands to 1

© Copyright Housemarque Oy 2002
© Copyright Paul Mensonides 2002

Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at www.boost.org/LICENSE_1_0.txt)