]> git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/preprocessor/doc/ref/list_first_n.html
bump version to 12.2.2-pve1
[ceph.git] / ceph / src / boost / libs / preprocessor / doc / ref / list_first_n.html
1 <html>
2 <head>
3 <title>BOOST_PP_LIST_FIRST_N</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_FIRST_N</b> macro expands to a <i>list</i> of the first <i>count</i> elements of a <i>list</i>.
9 </div>
10 <h4>Usage</h4>
11 <div class="code">
12 <b>BOOST_PP_LIST_FIRST_N</b>(<i>count</i>, <i>list</i>)
13 </div>
14 <h4>Arguments</h4>
15 <dl>
16 <dt>count</dt>
17 <dd>
18 The number of elements to extract.
19 </dd>
20 <dt>list</dt>
21 <dd>
22 The <i>list</i> from which the elements are extracted.
23 </dd>
24 </dl>
25 <h4>Remarks</h4>
26 <div>
27 This macro extracts <i>count</i> elements from the beginning of <i>list</i> and returns them as a <i>list</i>
28 </div>
29 <div>
30 Previously, this macro could not be used inside <b>BOOST_PP_WHILE</b>.&nbsp;
31 There is no longer any such restriction.&nbsp;
32 It is more efficient, however, to use <b>BOOST_PP_LIST_FIRST_N_D</b> in such a situation.
33 </div>
34 <h4>See Also</h4>
35 <ul>
36 <li><a href="list_first_n_d.html">BOOST_PP_LIST_FIRST_N_D</a></li>
37 </ul>
38 <h4>Requirements</h4>
39 <div>
40 <b>Header:</b> &nbsp;<a href="../headers/list/first_n.html">&lt;boost/preprocessor/list/first_n.hpp&gt;</a>
41 </div>
42 <h4>Sample Code</h4>
43 <div><pre>
44 #include &lt;<a href="../headers/list/first_n.html">boost/preprocessor/list/first_n.hpp</a>&gt;
45
46 #define LIST (a, (b, (c, <a href="nil.html">BOOST_PP_NIL</a>)))
47
48 <a href="list_first_n.html">BOOST_PP_LIST_FIRST_N</a>(2, LIST) // expands to (a, (b, <a href="nil.html">BOOST_PP_NIL</a>))
49 </pre></div>
50 <hr size="1">
51 <div style="margin-left: 0px;">
52 <i>© Copyright <a href="http://www.housemarque.com" target="_top">Housemarque Oy</a> 2002</i>
53 </br><i>© Copyright Paul Mensonides 2002</i>
54 </div>
55 <div style="margin-left: 0px;">
56 <p><small>Distributed under the Boost Software License, Version 1.0. (See
57 accompanying file <a href="../../../../LICENSE_1_0.txt">LICENSE_1_0.txt</a> or
58 copy at <a href=
59 "http://www.boost.org/LICENSE_1_0.txt">www.boost.org/LICENSE_1_0.txt</a>)</small></p>
60 </div>
61 </body>
62 </html>