Back to Arangodb

BOOST_PP_APPLY

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

3.12.9.11.3 KB
Original Source

The BOOST_PP_APPLY macro abstracts the difference between an argument and nothing.

Usage

BOOST_PP_APPLY (x)

Arguments

x The abstracted argument. This argument must be either BOOST_PP_NIL or a tuple with one element--such as (arg) or ((a, b)).

Remarks

If x is BOOST_PP_NIL , this macro expands to nothing. If x is a one element tuple, it expands to the contents of that tuple.

See Also

Requirements

Header: <boost/preprocessor/facilities/apply.hpp>

Sample Code

#include <[boost/preprocessor/facilities/apply.hpp](../headers/facilities/apply.html)>
#include <[boost/preprocessor/tuple/elem.hpp](../headers/tuple/elem.html)>

#define CV(i) \[BOOST\_PP\_APPLY](apply.html)( \[BOOST\_PP\_TUPLE\_ELEM](tuple_elem.html)( \
         4, i, \
         ([BOOST\_PP\_NIL](nil.html), (const), (volatile), (const volatile)) \
      ) \
   ) \
   /**/

CV(0) // expands to nothing
CV(1) // expands to const

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)