3 <title>BOOST_PP_LIST_FOR_EACH_PRODUCT_R
</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_R
</b> macro repeats a macro for each cartesian product of several
<i>lists
</i>.
9 It reenters
<b>BOOST_PP_FOR
</b> with maximum efficiency.
13 <b>BOOST_PP_LIST_FOR_EACH_PRODUCT_R
</b>(
<i>r
</i>,
<i>macro
</i>,
<i>size
</i>,
<i>tuple
</i>)
19 The next available
<b>BOOST_PP_FOR
</b> repetition.
23 The binary macro of the form
<i>macro
</i>(
<i>r
</i>,
<i>product
</i>).
24 This macro is expanded by
<b>BOOST_PP_FOR_EACH_PRODUCT
</b> with each cartesian product in
<i>tuple
</i>.
25 It is expanded with the next available
<b>BOOST_PP_FOR
</b> repetition and a
<i>tuple
</i> containing a cartesian product.
26 This
<i>tuple
</i> will have
<i>size
</i> elements.
30 The size of
<i>tuple
</i>.
34 A
<i>tuple
</i> of
<i>lists
</i> from which cartesian products are obtained.
39 This macro is a repetition construct.
40 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>))),
41 this macro will produce the following sequence:
43 <i>macro
</i>(
<i>r
</i>, (
<i>a
</i>,
<i>x
</i>))
44 <i>macro
</i>(
<i>r
</i>, (
<i>a
</i>,
<i>y
</i>))
45 <i>macro
</i>(
<i>r
</i>, (
<i>a
</i>,
<i>z
</i>))
<br>
46 <i>macro
</i>(
<i>r
</i>, (
<i>b
</i>,
<i>x
</i>))
47 <i>macro
</i>(
<i>r
</i>, (
<i>b
</i>,
<i>y
</i>))
48 <i>macro
</i>(
<i>r
</i>, (
<i>b
</i>,
<i>z
</i>))
<br>
49 <i>macro
</i>(
<i>r
</i>, (
<i>c
</i>,
<i>x
</i>))
50 <i>macro
</i>(
<i>r
</i>, (
<i>c
</i>,
<i>y
</i>))
51 <i>macro
</i>(
<i>r
</i>, (
<i>c
</i>,
<i>z
</i>))
56 <li><a href=
"list_for_each_product.html">BOOST_PP_LIST_FOR_EACH_PRODUCT
</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/arithmetic/dec.html">boost/preprocessor/arithmetic/dec.hpp
</a>>
65 #include
<<a href=
"../headers/list/for_each_product.html">boost/preprocessor/list/for_each_product.hpp
</a>>
66 #include
<<a href=
"../headers/repetition/for.html">boost/preprocessor/repetition/for.hpp
</a>>
67 #include
<<a href=
"../headers/tuple/elem.html">boost/preprocessor/tuple/elem.hpp
</a>>
69 #define L1 (a, (b,
<a href=
"nil.html">BOOST_PP_NIL
</a>))
70 #define L2 (x, (y,
<a href=
"nil.html">BOOST_PP_NIL
</a>))
72 #define PRED(r, state)
<a href=
"tuple_elem.html">BOOST_PP_TUPLE_ELEM
</a>(
2,
0, state)
74 #define OP(r, state) \
76 <a href=
"dec.html">BOOST_PP_DEC
</a>( \
77 <a href=
"tuple_elem.html">BOOST_PP_TUPLE_ELEM
</a>(
2,
0, state) \
79 <a href=
"tuple_elem.html">BOOST_PP_TUPLE_ELEM
</a>(
2,
1, state) \
83 #define MACRO(r, state) \
86 <a href=
"tuple_elem.html">BOOST_PP_TUPLE_ELEM
</a>(
2,
0, state), \
87 <a href=
"tuple_elem.html">BOOST_PP_TUPLE_ELEM
</a>(
2,
1, state) \
91 #define MACRO_I(r, c, t) \
92 <a href=
"list_for_each_product_r.html">BOOST_PP_LIST_FOR_EACH_PRODUCT_R
</a>( \
95 <a href=
"tuple_elem.html">BOOST_PP_TUPLE_ELEM
</a>(
2,
<a href=
"dec.html">BOOST_PP_DEC
</a>(c), t), \
96 <a href=
"tuple_elem.html">BOOST_PP_TUPLE_ELEM
</a>(
2,
<a href=
"dec.html">BOOST_PP_DEC
</a>(c), t) \
101 #define MACRO_P(r, product) product
103 <a href=
"for.html">BOOST_PP_FOR
</a>((
2, (L1, L2)), PRED, OP, MACRO)
104 // expands to (x, x) (x, y) (y, x) (y, y) (a, a) (a, b) (b, a) (b, b)
107 <div style=
"margin-left: 0px;">
108 <i>© Copyright
<a href=
"http://www.housemarque.com" target=
"_top">Housemarque Oy
</a> 2002</i>
109 </br><i>© Copyright Paul Mensonides
2002</i>
111 <div style=
"margin-left: 0px;">
112 <p><small>Distributed under the Boost Software License, Version
1.0. (See
113 accompanying file
<a href=
"../../../../LICENSE_1_0.txt">LICENSE_1_0.txt
</a> or
115 "http://www.boost.org/LICENSE_1_0.txt">www.boost.org/LICENSE_1_0.txt
</a>)
</small></p>