The BOOST_PP_LIST_FOR_EACH macro repeats a macro for each element in a list.
Usage
BOOST_PP_LIST_FOR_EACH(macro, data, list)
Arguments
- macro
-
A ternary macro of the form macro(r, data, elem).
This macro is expanded by BOOST_PP_LIST_FOR_EACH with each element in list.
It is expanded with the next available BOOST_PP_FOR repetition, the auxiliary data, and the current element.
- data
-
Auxiliary data passed to macro.
- list
-
The list for which macro will be invoked on each element.
Remarks
This macro is a repetition construct.
If
list is (
a, (
b, (
c,
BOOST_PP_NIL))), it expands to the sequence:
macro(r, data, a) macro(r, data, b) macro(r, data, c)
Previously, this macro could not be used inside BOOST_PP_FOR.
There is no longer any such restriction.
It is more efficient, however, to use BOOST_PP_LIST_FOR_EACH_R in such a situation.
See Also
Requirements
Sample Code