3 <title>BOOST_PP_SEQ_FOR_EACH_I
</title>
4 <link rel=
"stylesheet" type=
"text/css" href=
"../styles.css">
7 <div style=
"margin-left: 0px;">
8 The
<b>BOOST_PP_SEQ_FOR_EACH_I
</b> macro repeats a macro for each element in a
<i>seq
</i>.
14 <b>BOOST_PP_SEQ_FOR_EACH_I
</b>(
<i>macro
</i>,
<i>data
</i>,
<i>seq
</i>)
22 A macro of the form
<i>macro
</i>(
<i>r
</i>,
<i>data
</i>,
<i>i
</i>,
<i>elem
</i>).
23 This macro is expanded by
<b>BOOST_PP_SEQ_FOR_EACH_I
</b> with each element in
<i>seq
</i>.
24 It is expanded with the next available
<b>BOOST_PP_FOR
</b> repetition, the
25 auxiliary
<i>data
</i>, the index of the current element, and the current
30 Auxiliary data passed to
<i>macro
</i>.
34 The
<i>seq
</i> for which
<i>macro
</i> will be invoked on each element.
41 This macro is a repetition construct.
If
<i>seq
</i> is (
<i>a
</i>)(
<i>b
</i>)(
<i>c
</i>),
42 it expands to the sequence:
44 <i>macro
</i>(
<i>r
</i>,
<i>data
</i>,
<i>0</i>,
<i>a
</i>)
<i>macro
</i>(
<i>r
</i>,
<i>data
</i>,
45 <i>1</i>,
<i>b
</i>)
<i>macro
</i>(
<i>r
</i>,
<i>data
</i>,
<i>2</i>,
<i>c
</i>)
49 For maximum efficiency, use
<b>BOOST_PP_SEQ_FOR_EACH_I_R
</a></li>
56 <a href=
"seq_for_each_i_r.html">BOOST_PP_SEQ_FOR_EACH_I_R
</a></li>
62 <b>Header:
</b> <a href=
"../headers/seq/for_each_i.html"><boost/preprocessor/seq/for_each_i.hpp
></a>
69 #include
<<a href=
"../headers/cat.html">boost/preprocessor/cat.hpp
</a>>
70 #include
<<a href=
"../headers/seq/for_each_i.html">boost/preprocessor/seq/for_each_i.hpp
</a>>
72 #define SEQ (a)(b)(c)(d)
74 #define MACRO(r, data, i, elem)
<a href=
"cat.html">BOOST_PP_CAT
</a>(elem,
<a href=
"cat.html">BOOST_PP_CAT
</a>(data, i))
76 <a href=
"seq_for_each_i.html">BOOST_PP_SEQ_FOR_EACH_I
</a>(MACRO, _, SEQ) // expands to a_0 b_1 c_2 d_3
80 <div style=
"margin-left: 0px;">
81 <i>© Copyright
<a href=
"http://www.housemarque.com" target=
"_top">Housemarque Oy
</a> 2002</i>
82 </br><i>© Copyright Paul Mensonides
2002</i>
84 <div style=
"margin-left: 0px;">
85 <p><small>Distributed under the Boost Software License, Version
1.0. (See
86 accompanying file
<a href=
"../../../../LICENSE_1_0.txt">LICENSE_1_0.txt
</a> or
88 "http://www.boost.org/LICENSE_1_0.txt">www.boost.org/LICENSE_1_0.txt
</a>)
</small></p>