]> git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/preprocessor/doc/ref/seq_for_each_product.html
bump version to 12.2.2-pve1
[ceph.git] / ceph / src / boost / libs / preprocessor / doc / ref / seq_for_each_product.html
1 <html>
2 <head>
3 <title>BOOST_PP_SEQ_FOR_EACH_PRODUCT</title>
4 <link rel="stylesheet" type="text/css" href="../styles.css">
5 </head>
6 <body>
7 <div style="margin-left: 0px;">
8 The <b>BOOST_PP_SEQ_FOR_EACH_PRODUCT</b> macro repeats a macro for each
9 cartesian product of several <i>seqs</i>.
10 </div>
11 <h4>
12 Usage
13 </h4>
14 <div class="code">
15 <b>BOOST_PP_SEQ_FOR_EACH_PRODUCT</b>(<i>macro</i>, <i>seqs</i>)
16 </div>
17 <h4>
18 Arguments
19 </h4>
20 <dl>
21 <dt>macro</dt>
22 <dd>
23 The binary macro of the form <i>macro</i>(<i>r</i>, <i>product</i>).&nbsp; This
24 macro is expanded by <b>BOOST_PP_FOR_EACH_PRODUCT</b> with each cartesian
25 product in <i>seqs</i>.&nbsp; It is expanded with the next available <b>BOOST_PP_FOR</b>
26 repetition and a <i>seq</i> containing a cartesian product.&nbsp;
27 </dd>
28 <dt>seqs</dt>
29 <dd>
30 A <i>seq</i> of <i>seqs</i> from which cartesian products are obtained.
31 </dd>
32 </dl>
33 <h4>
34 Remarks
35 </h4>
36 <div>
37 This macro is a repetition construct.&nbsp; If two <i>seqs</i> are (<i>a</i>)(<i>b</i>)(<i>c</i>)
38 and (<i>x</i>)(<i>y</i>)(<i>z</i>), this macro will produce the following
39 sequence:
40 <div>
41 <i>macro</i>(<i>r</i>, (<i>a</i>)(<i>x</i>)) <i>macro</i>(<i>r</i>, (<i>a</i>)(<i>y</i>))
42 <i>macro</i>(<i>r</i>, (<i>a</i>)(<i>z</i>)) \
43 <br>
44 <i>macro</i>(<i>r</i>, (<i>b</i>)(<i>x</i>)) <i>macro</i>(<i>r</i>, (<i>b</i>)(<i>y</i>))
45 <i>macro</i>(<i>r</i>, (<i>b</i>)(<i>z</i>)) \
46 <br>
47 <i>macro</i>(<i>r</i>, (<i>c</i>)(<i>x</i>)) <i>macro</i>(<i>r</i>, (<i>c</i>)(<i>y</i>))
48 <i>macro</i>(<i>r</i>, (<i>c</i>)(<i>z</i>))
49 </div>
50 </div>
51 <div>
52 For maximum efficiency, use <b>BOOST_PP_SEQ_FOR_EACH_PRODUCT_R</b>.
53 </div>
54 <h4>
55 See Also
56 </h4>
57 <ul>
58 <li>
59 <a href="seq_for_each_product_r.html">BOOST_PP_SEQ_FOR_EACH_PRODUCT_R</a></li>
60 </ul>
61 <h4>
62 Requirements
63 </h4>
64 <div>
65 <b>Header:</b> &nbsp;<a href="../headers/seq/for_each_product.html">&lt;boost/preprocessor/seq/for_each_product.hpp&gt;</a>
66 </div>
67 <h4>
68 Sample Code
69 </h4>
70 <div>
71 <pre>
72 #include &lt;<a href="../headers/seq/for_each_product.html">boost/preprocessor/seq/for_each_product.hpp</a>&gt;
73 #include &lt;<a href="../headers/seq/to_tuple.html">boost/preprocessor/seq/to_tuple.hpp</a>&gt;
74
75 #define S1 (a)(b)(c)
76 #define S2 (x)(y)(z)
77 #define S3 (p)(q)
78
79 #define MACRO(r, product) <a href="seq_to_tuple.html">BOOST_PP_SEQ_TO_TUPLE</a>(product)
80
81 <a href="seq_for_each_product.html">BOOST_PP_SEQ_FOR_EACH_PRODUCT</a>(MACRO, (S1)(S2)(S3))
82 // expands to:
83 // (a, x, p) (a, x, q) (a, y, p) (a, y, q) (a, z, p) (a, z, q)
84 // (b, x, p) (b, x, q) (b, y, p) (b, y, q) (b, z, p) (b, z, q)
85 // (c, x, p) (c, x, q) (c, y, p) (c, y, q) (c, z, p) (c, z, q)
86 </pre>
87 </div>
88 <hr size="1">
89 <div style="margin-left: 0px;">
90 <i>© Copyright <a href="http://www.housemarque.com" target="_top">Housemarque Oy</a> 2002</i>
91 </br><i>© Copyright Paul Mensonides 2002</i>
92 </div>
93 <div style="margin-left: 0px;">
94 <p><small>Distributed under the Boost Software License, Version 1.0. (See
95 accompanying file <a href="../../../../LICENSE_1_0.txt">LICENSE_1_0.txt</a> or
96 copy at <a href=
97 "http://www.boost.org/LICENSE_1_0.txt">www.boost.org/LICENSE_1_0.txt</a>)</small></p>
98 </div>
99 </body>
100 </html>