The BOOST_PP_VARIADIC_ELEM variadic macro extracts an element from variadic data.

Usage

BOOST_PP_VARIADIC_ELEM(i, ...) (v)

Arguments

i
The zero-based index into the variadic data of the element to be extracted.  Valid values range from 0 to the size of the variadic data - 1.
...
The variadic data from which an element is to be extracted.

Remarks

The index i must be less than the size of the variadic data.

See Also

Requirements

Header:  <boost/preprocessor/variadic/elem.hpp>

Sample Code

#include <boost/preprocessor/variadic/elem.hpp>

#define VAR_DATA a, b, c, d

BOOST_PP_VARIADIC_ELEM(0, VAR_DATA) // expands to a
BOOST_PP_VARIADIC_ELEM(3, VAR_DATA) // expands to d

© Copyright Edward Diener 2011,2013

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)