3 <title>BOOST_PP_LIST_FOR_EACH
</title>
4 <link rel=
"stylesheet" type=
"text/css" href=
"../styles.css">
7 <div style=
"margin-left: 0px;">
8 The
<b>BOOST_PP_LIST_FOR_EACH
</b> macro repeats a macro for each element in a
<i>list
</i>.
12 <b>BOOST_PP_LIST_FOR_EACH
</b>(
<i>macro
</i>,
<i>data
</i>,
<i>list
</i>)
18 A ternary macro of the form
<i>macro
</i>(
<i>r
</i>,
<i>data
</i>,
<i>elem
</i>).
19 This macro is expanded by
<b>BOOST_PP_LIST_FOR_EACH
</b> with each element in
<i>list
</i>.
20 It is expanded with the next available
<b>BOOST_PP_FOR
</b> repetition, the auxiliary
<i>data
</i>, and the current element.
24 Auxiliary data passed to
<i>macro
</i>.
28 The
<i>list
</i> for which
<i>macro
</i> will be invoked on each element.
33 This macro is a repetition construct.
34 If
<i>list
</i> is (
<i>a
</i>, (
<i>b
</i>, (
<i>c
</i>,
<b>BOOST_PP_NIL
</b>))), it expands to the sequence:
36 <i>macro
</i>(
<i>r
</i>,
<i>data
</i>,
<i>a
</i>)
<i>macro
</i>(
<i>r
</i>,
<i>data
</i>,
<i>b
</i>)
<i>macro
</i>(
<i>r
</i>,
<i>data
</i>,
<i>c
</i>)
40 Previously, this macro could not be used inside
<b>BOOST_PP_FOR
</b>.
41 There is no longer any such restriction.
42 It is more efficient, however, to use
<b>BOOST_PP_LIST_FOR_EACH_R
</b> in such a situation.
46 <li><a href=
"list_for_each_r.html">BOOST_PP_LIST_FOR_EACH_R
</a></li>
50 <b>Header:
</b> <a href=
"../headers/list/for_each.html"><boost/preprocessor/list/for_each.hpp
></a>
54 #include
<<a href=
"../headers/cat.html">boost/preprocessor/cat.hpp
</a>>
55 #include
<<a href=
"../headers/list/for_each.html">boost/preprocessor/list/for_each.hpp
</a>>
57 #define LIST (w, (x, (y, (z,
<a href=
"nil.html">BOOST_PP_NIL
</a>))))
59 #define MACRO(r, data, elem)
<a href=
"cat.html">BOOST_PP_CAT
</a>(elem, data)
61 <a href=
"list_for_each.html">BOOST_PP_LIST_FOR_EACH
</a>(MACRO, _, LIST) // expands to w_ x_ y_ z_
64 <div style=
"margin-left: 0px;">
65 <i>© Copyright
<a href=
"http://www.housemarque.com" target=
"_top">Housemarque Oy
</a> 2002</i>
66 </br><i>© Copyright Paul Mensonides
2002</i>
68 <div style=
"margin-left: 0px;">
69 <p><small>Distributed under the Boost Software License, Version
1.0. (See
70 accompanying file
<a href=
"../../../../LICENSE_1_0.txt">LICENSE_1_0.txt
</a> or
72 "http://www.boost.org/LICENSE_1_0.txt">www.boost.org/LICENSE_1_0.txt
</a>)
</small></p>