Back to Arangodb

BOOST_PP_IF

3rdParty/boost/1.78.0/libs/preprocessor/doc/ref/if.html

3.12.9.11.2 KB
Original Source

The BOOST_PP_IF macro chooses between to values based on a logical condition.

Usage

BOOST_PP_IF (cond, t, f)

Arguments

cond The condition that determines if the result is expr or nothing. Valid values range from 0 to BOOST_PP_LIMIT_MAG. t The result of the expansion if cond is non-zero. f The result of the expansion if cond is 0.

Remarks

This macro performs a boolean conversion on its first argument. If that conversion is unnecessary, use BOOST_PP_IIF instead.

See Also

Requirements

Header: <boost/preprocessor/control/if.hpp>

Sample Code

#include <[boost/preprocessor/control/if.hpp](../headers/control/if.html)>[BOOST\_PP\_IF](if.html)(10, a, b) // expands to a[BOOST\_PP\_IF](if.html)(0, a, b) // expands to b

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)