]> git.proxmox.com Git - ceph.git/blame - ceph/src/boost/libs/preprocessor/doc/ref/list_for_each_product.html
bump version to 12.2.2-pve1
[ceph.git] / ceph / src / boost / libs / preprocessor / doc / ref / list_for_each_product.html
CommitLineData
7c673cae
FG
1<html>
2<head>
3 <title>BOOST_PP_LIST_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_LIST_FOR_EACH_PRODUCT</b> macro repeats a macro for each cartesian product of several <i>lists</i>.
9 </div>
10 <h4>Usage</h4>
11 <div class="code">
12 <b>BOOST_PP_LIST_FOR_EACH_PRODUCT</b>(<i>macro</i>, <i>size</i>, <i>tuple</i>)
13 </div>
14 <h4>Arguments</h4>
15 <dl>
16 <dt>macro</dt>
17 <dd>
18 The binary macro of the form <i>macro</i>(<i>r</i>, <i>product</i>).&nbsp;
19 This macro is expanded by <b>BOOST_PP_FOR_EACH_PRODUCT</b> with each cartesian product in <i>tuple</i>.&nbsp;
20 It is expanded with the next available <b>BOOST_PP_FOR</b> repetition and a <i>tuple</i> containing a cartesian product.&nbsp;
21 This <i>tuple</i> will have <i>size</i> elements.
22 </dd>
23 <dt>size</dt>
24 <dd>
25 The size of <i>tuple</i>.
26 </dd>
27 <dt>tuple</dt>
28 <dd>
29 A <i>tuple</i> of <i>lists</i> from which cartesian products are obtained.
30 </dd>
31 </dl>
32 <h4>Remarks</h4>
33 <div>
34 This macro is a repetition construct.&nbsp;
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:
37 <div>
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>))
47 </div>
48 </div>
49 <div>
50 Previously, this macro could not be used inside <b>BOOST_PP_FOR</b>.&nbsp;
51 There is no longer any such restriction.&nbsp;
52 It is more efficient, however, to use <b>BOOST_PP_LIST_FOR_EACH_PRODUCT_R</b> in such a situation.
53 </div>
54 <h4>See Also</h4>
55 <ul>
56 <li><a href="list_for_each_product_r.html">BOOST_PP_LIST_FOR_EACH_PRODUCT_R</a></li>
57 </ul>
58 <h4>Requirements</h4>
59 <div>
60 <b>Header:</b> &nbsp;<a href="../headers/list/for_each_product.html">&lt;boost/preprocessor/list/for_each_product.hpp&gt;</a>
61 </div>
62 <h4>Sample Code</h4>
63<div><pre>
64#include &lt;<a href="../headers/list/for_each_product.html">boost/preprocessor/list/for_each_product.hpp</a>&gt;
65
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>)))
68
69#define MACRO(r, product) product
70
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)
73</pre></div>
74 <hr size="1">
75 <div style="margin-left: 0px;">
76