diff --git a/doc/reference/list_adt.htm b/doc/reference/list_adt.htm index c126cec..2fbe5d6 100644 --- a/doc/reference/list_adt.htm +++ b/doc/reference/list_adt.htm @@ -57,7 +57,21 @@

Both of the above lists contain 5 elements: 1, 2, 3, 4 and 5.

-

Longer lists can be built with the help of BOOST_PP_LIST_APPEND().

+

Longer lists can be built from short lists with BOOST_PP_LIST_APPEND_D() +and BOOST_PP_LIST_FOLD_RIGHT_2ND():

+ +
+  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) )
+    )
+  )
+

diff --git a/include/boost/preprocessor/list/adt.hpp b/include/boost/preprocessor/list/adt.hpp index 5efaee2..9fbc580 100644 --- a/include/boost/preprocessor/list/adt.hpp +++ b/include/boost/preprocessor/list/adt.hpp @@ -48,7 +48,21 @@ BOOST_PP_LIST_CONS(). For example,

Both of the above lists contain 5 elements: 1, 2, 3, 4 and 5.

-

Longer lists can be built with the help of BOOST_PP_LIST_APPEND().

+

Longer lists can be built from short lists with BOOST_PP_LIST_APPEND_D() +and BOOST_PP_LIST_FOLD_RIGHT_2ND():

+ +
+  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) )
+    )
+  )
+
*/ #define BOOST_PP_LIST_CONS(H,T) (H,T,1)