The BOOST_PP_TUPLE_EAT macro expands to a macro that eats a tuple.






The size of the tuple to be eaten.  Valid tuple sizes range from 1 to BOOST_PP_LIMIT_TUPLE.


The size argument must be the actual size of the tuple in the non-variadic version.

For the variadic version (v) the size may be left out completely so that the macro can be invoked as BOOST_PP_TUPLE_EAT(); you may get a warning from some compilers, but the functionality will still work. If you specify a size in the variadic version, it will be ignored, but the warning from some compilers will not occur.

See Also


Header:  <boost/preprocessor/tuple/eat.hpp>

Sample Code

#include <boost/preprocessor/control/if.hpp>
#include <boost/preprocessor/tuple/eat.hpp>

#define OP(a, b) (a b)

#define MACRO(n) BOOST_PP_IF(n, OP, BOOST_PP_TUPLE_EAT(2))(1, 2)

// or for the variadic version (v)

#define MACRO(n) BOOST_PP_IF(n, OP, BOOST_PP_TUPLE_EAT())(1, 2)

MACRO(0) // expands to nothing
MACRO(1) // expands to (1, 2)

Copyright Housemarque Oy 2002
Copyright Paul Mensonides 2002
Copyright Edward Diener 2011,2013

Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at