The BOOST_PP_ARRAY_ELEM macro extracts an element from a array.

Usage

BOOST_PP_ARRAY_ELEM(i, array)

Arguments

i
The zero-based index into the array of the element to be extracted. 
array
The array from which an element is to be extracted.  This array must contain at least i + 1 elements.

Requirements

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

Sample Code

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

#define ARRAY (4, (a, b, c, d))

BOOST_PP_ARRAY_ELEM(0, ARRAY) // expands to a
BOOST_PP_ARRAY_ELEM(3, ARRAY) // expands to d

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)