]>
Commit | Line | Data |
---|---|---|
7c673cae FG |
1 | <html> |
2 | <head> | |
3 | <title>BOOST_PP_LIST_AT_D</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_AT_D</b> macro extracts an element in a <i>list</i>. | |
9 | It reenters <b>BOOST_PP_WHILE</b> with maximum efficiency. | |
10 | </div> | |
11 | <h4>Usage</h4> | |
12 | <div class="code"> | |
13 | <b>BOOST_PP_LIST_AT_D</b>(<i>d</i>, <i>list</i>, <i>index</i>) | |
14 | </div> | |
15 | <h4>Arguments</h4> | |
16 | <dl> | |
17 | <dt>d</dt> | |
18 | <dd> | |
19 | The next available <b>BOOST_PP_WHILE</b> iteration. | |
20 | </dd> | |
21 | <dt>list</dt> | |
22 | <dd> | |
23 | The <i>list</i> from which a element is to be extracted. | |
24 | This <i>list</i> must have at least <i>index</i> + <i>1</i> elements. | |
25 | </dd> | |
26 | <dt>index</dt> | |
27 | <dd> | |
28 | The zero-based position in the <i>list</i> of the element to be extracted. | |
29 | </dd> | |
30 | </dl> | |
31 | <h4>See Also</h4> | |
32 | <ul> | |
33 | <li><a href="list_at.html">BOOST_PP_LIST_AT</a></li> | |
34 | </ul> | |
35 | <h4>Requirements</h4> | |
36 | <div> | |
37 | <b>Header:</b> <a href="../headers/list/at.html"><boost/preprocessor/list/at.hpp></a> | |
38 | </div> | |
39 | <h4>Sample Code</h4> | |
40 | <div><pre> | |
41 | #include <<a href="../headers/control/while.html">boost/preprocessor/control/while.hpp</a>> | |
42 | #include <<a href="../headers/list/at.html">boost/preprocessor/list/at.hpp</a>> | |
43 | ||
44 | #define LIST (7, (2, (0, (1, <a href="nil.html">BOOST_PP_NIL</a>)))) | |
45 | ||
46 | #define PRED(d, state) <a href="list_at_d.html">BOOST_PP_LIST_AT_D</a>(d, state, 0) | |
47 | #define OP(d, state) <a href="list_rest.html">BOOST_PP_LIST_REST</a>(state) | |
48 | ||
49 | <a href="while.html">BOOST_PP_WHILE</a>(PRED, OP, LIST) // expands to (0, (1, <a href="nil.html">BOOST_PP_NIL</a>)) | |
50 | </pre></div> | |
51 | <hr size="1"> | |
52 | <div style="margin-left: 0px;"> | |
53 |