3 <title>BOOST_PP_LIST_FOR_EACH_PRODUCT
</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_PRODUCT
</b> macro repeats a macro for each cartesian product of several
<i>lists
</i>.
12 <b>BOOST_PP_LIST_FOR_EACH_PRODUCT
</b>(
<i>macro
</i>,
<i>size
</i>,
<i>tuple
</i>)
18 The binary macro of the form
<i>macro
</i>(
<i>r
</i>,
<i>product
</i>).
19 This macro is expanded by
<b>BOOST_PP_FOR_EACH_PRODUCT
</b> with each cartesian product in
<i>tuple
</i>.
20 It is expanded with the next available
<b>BOOST_PP_FOR
</b> repetition and a
<i>tuple
</i> containing a cartesian product.
21 This
<i>tuple
</i> will have
<i>size
</i> elements.
25 The size of
<i>tuple
</i>.
29 A
<i>tuple
</i> of
<i>lists
</i> from which cartesian products are obtained.
34 This macro is a repetition construct.
35 If two
<i>lists
</i> are (
<i>a
</i>, (
<i>b
</i>, (
<i>c
</i>,
<b>BOOST_PP_NIL
</b>))) and (
<i>x
</i>, (
<i>y
</i>, (
<i>z
</i>,
<b>BOOST_PP_NIL
</b>))),
36 this macro will produce the following sequence:
38 <i>macro
</i>(
<i>r
</i>, (
<i>a
</i>,
<i>x
</i>))
39 <i>macro
</i>(
<i>r
</i>, (
<i>a
</i>,
<i>y
</i>))
40 <i>macro
</i>(
<i>r
</i>, (
<i>a
</i>,
<i>z
</i>))
<br>
41 <i>macro
</i>(
<i>r
</i>, (
<i>b
</i>,
<i>x
</i>))
42 <i>macro
</i>(
<i>r
</i>, (
<i>b
</i>,
<i>y
</i>))
43 <i>macro
</i>(
<i>r
</i>, (
<i>b
</i>,
<i>z
</i>))
<br>
44 <i>macro
</i>(
<i>r
</i>, (
<i>c
</i>,
<i>x
</i>))
45 <i>macro
</i>(
<i>r
</i>, (
<i>c
</i>,
<i>y
</i>))
46 <i>macro
</i>(
<i>r
</i>, (
<i>c
</i>,
<i>z
</i>))
50 Previously, this macro could not be used inside
<b>BOOST_PP_FOR
</b>.
51 There is no longer any such restriction.
52 It is more efficient, however, to use
<b>BOOST_PP_LIST_FOR_EACH_PRODUCT_R
</b> in such a situation.
56 <li><a href=
"list_for_each_product_r.html">BOOST_PP_LIST_FOR_EACH_PRODUCT_R
</a></li>
60 <b>Header:
</b> <a href=
"../headers/list/for_each_product.html"><boost/preprocessor/list/for_each_product.hpp
></a>
64 #include
<<a href=
"../headers/list/for_each_product.html">boost/preprocessor/list/for_each_product.hpp
</a>>
66 #define L1 (a, (b, (c,
<a href=
"nil.html">BOOST_PP_NIL
</a>)))
67 #define L2 (x, (y, (z,
<a href=
"nil.html">BOOST_PP_NIL
</a>)))
69 #define MACRO(r, product) product
71 <a href=
"list_for_each_product.html">BOOST_PP_LIST_FOR_EACH_PRODUCT
</a>(MACRO,
2, (L1, L2))
72 // expands to (a, x) (a, y) (a, z) (b, x) (b, y) (b, z) (c, x) (c, y) (c, z)
75 <div style=
"margin-left: 0px;">
76 <i>© Copyright
<a href=
"http://www.housemarque.com" target=
"_top">Housemarque Oy
</a> 2002</i>
77 </br><i>© Copyright Paul Mensonides
2002</i>
79 <div style=
"margin-left: 0px;">
80 <p><small>Distributed under the Boost Software License, Version
1.0. (See
81 accompanying file
<a href=
"../../../../LICENSE_1_0.txt">LICENSE_1_0.txt
</a> or
83 "http://www.boost.org/LICENSE_1_0.txt">www.boost.org/LICENSE_1_0.txt
</a>)
</small></p>