mirror of
https://github.com/boostorg/preprocessor.git
synced 2025-07-13 20:46:34 +02:00
How to make longer lists
[SVN r13037]
This commit is contained in:
@ -57,7 +57,21 @@
|
||||
|
||||
<p>Both of the above lists contain 5 elements: 1, 2, 3, 4 and 5.</p>
|
||||
|
||||
<p>Longer lists can be built with the help of <a href="list_append.htm#BOOST_PP_LIST_APPEND">BOOST_PP_LIST_APPEND</a>().</p>
|
||||
<p>Longer lists can be built from short lists with <a href="list_append.htm#BOOST_PP_LIST_APPEND_D">BOOST_PP_LIST_APPEND_D</a>()
|
||||
and <a href="list_fold_right_2nd.htm#BOOST_PP_LIST_FOLD_RIGHT_2ND">BOOST_PP_LIST_FOLD_RIGHT_2ND</a>():</p>
|
||||
|
||||
<pre>
|
||||
<a href="list_fold_right_2nd.htm#BOOST_PP_LIST_FOLD_RIGHT_2ND">BOOST_PP_LIST_FOLD_RIGHT_2ND</a>
|
||||
( <a href="list_append.htm#BOOST_PP_LIST_APPEND_D">BOOST_PP_LIST_APPEND_D</a>
|
||||
, <a href="tuple_to_list.htm#BOOST_PP_TUPLE_TO_LIST">BOOST_PP_TUPLE_TO_LIST</a>
|
||||
( N
|
||||
, <a href="tuple_to_list.htm#BOOST_PP_TUPLE_TO_LIST">BOOST_PP_TUPLE_TO_LIST</a>(M, (E11, E12, ..., E1M) )
|
||||
, <a href="tuple_to_list.htm#BOOST_PP_TUPLE_TO_LIST">BOOST_PP_TUPLE_TO_LIST</a>(M, (E21, E22, ..., E2M) )
|
||||
, ...
|
||||
, <a href="tuple_to_list.htm#BOOST_PP_TUPLE_TO_LIST">BOOST_PP_TUPLE_TO_LIST</a>(M, (EN1, EN2, ..., ENM) )
|
||||
)
|
||||
)
|
||||
</pre>
|
||||
|
||||
<hr>
|
||||
|
||||
|
@ -48,7 +48,21 @@ BOOST_PP_LIST_CONS(). For example,</p>
|
||||
|
||||
<p>Both of the above lists contain 5 elements: 1, 2, 3, 4 and 5.</p>
|
||||
|
||||
<p>Longer lists can be built with the help of BOOST_PP_LIST_APPEND().</p>
|
||||
<p>Longer lists can be built from short lists with BOOST_PP_LIST_APPEND_D()
|
||||
and BOOST_PP_LIST_FOLD_RIGHT_2ND():</p>
|
||||
|
||||
<pre>
|
||||
BOOST_PP_LIST_FOLD_RIGHT_2ND
|
||||
( BOOST_PP_LIST_APPEND_D
|
||||
, BOOST_PP_TUPLE_TO_LIST
|
||||
( N
|
||||
, BOOST_PP_TUPLE_TO_LIST(M, (E11, E12, ..., E1M) )
|
||||
, BOOST_PP_TUPLE_TO_LIST(M, (E21, E22, ..., E2M) )
|
||||
, ...
|
||||
, BOOST_PP_TUPLE_TO_LIST(M, (EN1, EN2, ..., ENM) )
|
||||
)
|
||||
)
|
||||
</pre>
|
||||
*/
|
||||
#define BOOST_PP_LIST_CONS(H,T) (H,T,1)
|
||||
|
||||
|
Reference in New Issue
Block a user