3 <title>BOOST_PP_LIST_FIRST_N_D
</title>
4 <link rel=
"stylesheet" type=
"text/css" href=
"../styles.css">
7 <div style=
"margin-left: 0px;">
8 The
<b>BOOST_PP_LIST_FIRST_N_D
</b> macro expands to a
<i>list
</i> of the first
<i>count
</i> elements of a
<i>list
</i>.
9 It reenters
<b>BOOST_PP_WHILE
</b> with maximum efficiency.
13 <b>BOOST_PP_LIST_FIRST_N_D
</b>(
<i>d
</i>,
<i>count
</i>,
<i>list
</i>)
19 The next available
<b>BOOST_PP_WHILE
</b> iteration.
23 The number of elements to extract.
27 The
<i>list
</i> from which the elements are extracted.
32 This macro extracts
<i>count
</i> elements from the beginning of
<i>list
</i> and returns them as a
<i>list
</i>
36 <li><a href=
"list_first_n.html">BOOST_PP_LIST_FIRST_N
</a></li>
40 <b>Header:
</b> <a href=
"../headers/list/first_n.html"><boost/preprocessor/list/first_n.hpp
></a>
44 #include
<<a href=
"../headers/list/first_n.html">boost/preprocessor/list/first_n.hpp
</a>>
45 #include
<<a href=
"../headers/list/fold_left.html">boost/preprocessor/list/fold_right.hpp
</a>>
47 #define L1 (a, (b, (c, (d,
<a href=
"nil.html">BOOST_PP_NIL
</a>))))
48 #define L2 (L1, (L1, (L1,
<a href=
"nil.html">BOOST_PP_NIL
</a>)))
50 #define OP(d, state, x) (
<a href=
"list_first_n_d.html">BOOST_PP_LIST_FIRST_N_D
</a>(d,
2, x), state)
52 <a href=
"list_fold_right.html">BOOST_PP_LIST_FOLD_RIGHT
</a>(OP,
<a href=
"nil.html">BOOST_PP_NIL
</a>, L2)
55 ((a, (b,
<a href=
"nil.html">BOOST_PP_NIL
</a>)), ((a, (b,
<a href=
"nil.html">BOOST_PP_NIL
</a>)),
56 ((a, (b,
<a href=
"nil.html">BOOST_PP_NIL
</a>)) ,
<a href=
"nil.html">BOOST_PP_NIL
</a> )))
60 <div style=
"margin-left: 0px;">
61 <i>© Copyright
<a href=
"http://www.housemarque.com" target=
"_top">Housemarque Oy
</a> 2002</i>
62 </br><i>© Copyright Paul Mensonides
2002</i>
64 <div style=
"margin-left: 0px;">
65 <p><small>Distributed under the Boost Software License, Version
1.0. (See
66 accompanying file
<a href=
"../../../../LICENSE_1_0.txt">LICENSE_1_0.txt
</a> or
68 "http://www.boost.org/LICENSE_1_0.txt">www.boost.org/LICENSE_1_0.txt
</a>)
</small></p>