The BOOST_PP_LIST_AT_D macro extracts an element in a list.
It reenters BOOST_PP_WHILE with maximum efficiency.
Usage
BOOST_PP_LIST_AT_D(d, list, index)
Arguments
- d
-
The next available BOOST_PP_WHILE iteration.
- list
-
The list from which a element is to be extracted.
This list must have at least index + 1 elements.
- index
-
The zero-based position in the list of the element to be extracted.
See Also
Requirements
Sample Code
#include <boost/preprocessor/control/while.hpp>
#include <boost/preprocessor/list/at.hpp>
#define LIST (7, (2, (0, (1, BOOST_PP_NIL))))
#define PRED(d, state) BOOST_PP_LIST_AT_D(d, state, 0)
#define OP(d, state) BOOST_PP_LIST_REST(state)
BOOST_PP_WHILE(PRED, OP, LIST) // expands to (0, (1, BOOST_PP_NIL))