forked from boostorg/preprocessor
Tweaking docs
[SVN r12604]
This commit is contained in:
@ -13,55 +13,55 @@
|
||||
* See http://www.boost.org for most recent version.
|
||||
*/
|
||||
|
||||
/** \file
|
||||
/** <P>This header defines the fundamental list operations.</P>
|
||||
|
||||
<a href="../../../../boost/preprocessor/list/adt.hpp">Click here to see the header.</a>
|
||||
|
||||
This header defines the fundamental list operations.
|
||||
|
||||
NOTE: The internal representation of lists is hidden. Although there aren't
|
||||
compelling reasons to change the representation, you should avoid writing
|
||||
code that depends on the internal representation details.
|
||||
<P>NOTE: The internal representation of lists is hidden. Although there
|
||||
aren't compelling reasons to change the representation, you should avoid
|
||||
writing code that depends on the internal representation details.</P>
|
||||
*/
|
||||
|
||||
#include <boost/preprocessor/tuple/elem.hpp>
|
||||
#include <boost/preprocessor/logical/not.hpp>
|
||||
|
||||
/** List constructor.
|
||||
/** <P>List constructor.</P>
|
||||
|
||||
Lists are build using list constructors BOOST_PP_LIST_NIL and
|
||||
BOOST_PP_LIST_CONS(). For example,
|
||||
<P>Lists are build using list constructors BOOST_PP_LIST_NIL and
|
||||
BOOST_PP_LIST_CONS(). For example,</P>
|
||||
|
||||
<PRE>\verbatim
|
||||
<PRE>
|
||||
BOOST_PP_LIST_CONS(1,
|
||||
BOOST_PP_LIST_CONS(2,
|
||||
BOOST_PP_LIST_CONS(3,
|
||||
BOOST_PP_LIST_CONS(4,
|
||||
BOOST_PP_LIST_CONS(5,
|
||||
BOOST_PP_LIST_NIL)))))
|
||||
\endverbatim</PRE>
|
||||
</PRE>
|
||||
|
||||
Short lists can also be build from tuples:
|
||||
<P>Short lists can also be build from tuples:</P>
|
||||
|
||||
<PRE>\verbatim
|
||||
<PRE>
|
||||
BOOST_PP_TUPLE_TO_LIST(5,(1,2,3,4,5))
|
||||
\endverbatim</PRE>
|
||||
</PRE>
|
||||
|
||||
Both of the above lists contain 5 elements: 1, 2, 3, 4 and 5.
|
||||
<P>Both of the above lists contain 5 elements: 1, 2, 3, 4 and 5.</P>
|
||||
*/
|
||||
#define BOOST_PP_LIST_CONS(H,T) (H,T,1)
|
||||
|
||||
/** List nil constructor.
|
||||
/** <P>List nil constructor.</P>
|
||||
|
||||
<H3>See</H3>
|
||||
- BOOST_PP_LIST_CONS()
|
||||
<UL>
|
||||
<LI>BOOST_PP_LIST_CONS()
|
||||
</UL>
|
||||
*/
|
||||
#define BOOST_PP_LIST_NIL (_,_,0)
|
||||
|
||||
/** Expands to 1 if the list is not nil and 0 otherwise.
|
||||
/** <P>Expands to 1 if the list is not nil and 0 otherwise.</P>
|
||||
|
||||
<H3>See</H3>
|
||||
- BOOST_PP_LIST_IS_NIL()
|
||||
<UL>
|
||||
<LI>BOOST_PP_LIST_IS_NIL()
|
||||
</UL>
|
||||
*/
|
||||
#if !defined(BOOST_NO_COMPILER_CONFIG) && defined(__MWERKS__) && __MWERKS__ <= 0x2406
|
||||
# define BOOST_PP_LIST_IS_CONS(L) BOOST_PP_TUPLE_ELEM(3,2,L)
|
||||
@ -69,10 +69,12 @@ Both of the above lists contain 5 elements: 1, 2, 3, 4 and 5.
|
||||
# define BOOST_PP_LIST_IS_CONS(L) BOOST_PP_TUPLE3_ELEM2 L
|
||||
#endif
|
||||
|
||||
/** Expands to 1 if the list is nil and 0 otherwise.
|
||||
/** <P>Expands to 1 if the list is nil and 0 otherwise.</P>
|
||||
|
||||
<H3>See</H3>
|
||||
- BOOST_PP_LIST_IS_CONS()
|
||||
<UL>
|
||||
<LI>BOOST_PP_LIST_IS_CONS()
|
||||
</UL>
|
||||
*/
|
||||
#if !defined(BOOST_NO_COMPILER_CONFIG) && defined(__MWERKS__) && __MWERKS__ <= 0x2406
|
||||
# define BOOST_PP_LIST_IS_NIL(L) BOOST_PP_NOT(BOOST_PP_TUPLE_ELEM(3,2,L))
|
||||
@ -80,18 +82,20 @@ Both of the above lists contain 5 elements: 1, 2, 3, 4 and 5.
|
||||
# define BOOST_PP_LIST_IS_NIL(L) BOOST_PP_NOT(BOOST_PP_TUPLE3_ELEM2 L)
|
||||
#endif
|
||||
|
||||
/** Expands to the first element of the list. The list must not be nil.
|
||||
/** <P>Expands to the first element of the list. The list must not be nil.</P>
|
||||
|
||||
For example,
|
||||
<P>For example,</P>
|
||||
|
||||
<PRE>\verbatim
|
||||
<PRE>
|
||||
BOOST_PP_LIST_FIRST(BOOST_PP_TUPLE_TO_LIST(5,(1,2,3,4,5)))
|
||||
\endverbatim</PRE>
|
||||
</PRE>
|
||||
|
||||
expands to 1.
|
||||
<P>expands to 1.</P>
|
||||
|
||||
<H3>See</H3>
|
||||
- BOOST_PP_LIST_REST()
|
||||
<UL>
|
||||
<LI>BOOST_PP_LIST_REST()
|
||||
</UL>
|
||||
*/
|
||||
#if !defined(BOOST_NO_COMPILER_CONFIG) && defined(__MWERKS__) && __MWERKS__ <= 0x2406
|
||||
# define BOOST_PP_LIST_FIRST(L) BOOST_PP_TUPLE_ELEM(3,0,L)
|
||||
@ -99,18 +103,20 @@ expands to 1.
|
||||
# define BOOST_PP_LIST_FIRST(L) BOOST_PP_TUPLE3_ELEM0 L
|
||||
#endif
|
||||
|
||||
/** Expands to a list of all but the first element of the list. The list must not be nil.
|
||||
/** <P>Expands to a list of all but the first element of the list. The list must not be nil.</P>
|
||||
|
||||
For example,
|
||||
<P>For example,</P>
|
||||
|
||||
<PRE>\verbatim
|
||||
<PRE>
|
||||
BOOST_PP_LIST_REST(BOOST_PP_TUPLE_TO_LIST(5,(1,2,3,4,5)))
|
||||
\endverbatim</PRE>
|
||||
</PRE>
|
||||
|
||||
expands to a list containing 2, 3, 4 and 5.
|
||||
<P>expands to a list containing 2, 3, 4 and 5.</P>
|
||||
|
||||
<H3>See</H3>
|
||||
- BOOST_PP_LIST_FIRST()
|
||||
<UL>
|
||||
<LI>BOOST_PP_LIST_FIRST()
|
||||
</UL>
|
||||
*/
|
||||
#if !defined(BOOST_NO_COMPILER_CONFIG) && defined(__MWERKS__) && __MWERKS__ <= 0x2406
|
||||
# define BOOST_PP_LIST_REST(L) BOOST_PP_TUPLE_ELEM(3,1,L)
|
||||
|
@ -13,28 +13,25 @@
|
||||
* See http://www.boost.org for most recent version.
|
||||
*/
|
||||
|
||||
/** \file
|
||||
|
||||
<a href="../../../../boost/preprocessor/list/append.hpp">Click here to see the header.</a>
|
||||
*/
|
||||
|
||||
#include <boost/preprocessor/list/fold_right.hpp>
|
||||
|
||||
/** Catenates two lists together.
|
||||
/** <P>Catenates two lists together.</P>
|
||||
|
||||
For example,
|
||||
<P>For example,</P>
|
||||
|
||||
<PRE>\verbatim
|
||||
<PRE>
|
||||
BOOST_PP_LIST_APPEND
|
||||
( BOOST_PP_TUPLE_TO_LIST(2,(1,2))
|
||||
, BOOST_PP_TUPLE_TO_LIST(2,(3,4))
|
||||
)
|
||||
\endverbatim</PRE>
|
||||
</PRE>
|
||||
|
||||
produces a list containing 1, 2, 3 and 4.
|
||||
<P>produces a list containing 1, 2, 3 and 4.</P>
|
||||
|
||||
<H3>Uses</H3>
|
||||
- BOOST_PP_WHILE()
|
||||
<UL>
|
||||
<LI>BOOST_PP_WHILE()
|
||||
</UL>
|
||||
*/
|
||||
#define BOOST_PP_LIST_APPEND(L,P) BOOST_PP_LIST_APPEND_D(0,L,P)
|
||||
|
||||
|
@ -13,25 +13,22 @@
|
||||
* See http://www.boost.org for most recent version.
|
||||
*/
|
||||
|
||||
/** \file
|
||||
|
||||
<a href="../../../../boost/preprocessor/list/at.hpp">Click here to see the header.</a>
|
||||
*/
|
||||
|
||||
#include <boost/preprocessor/list/rest_n.hpp>
|
||||
|
||||
/** Expands to the I:th element of the list L. The first element is at index 0.
|
||||
/** <P>Expands to the I:th element of the list L. The first element is at index 0.</P>
|
||||
|
||||
For example,
|
||||
<P>For example,</P>
|
||||
|
||||
<PRE>\verbatim
|
||||
<PRE>
|
||||
BOOST_PP_LIST_AT(BOOST_PP_TUPLE_TO_LIST(3,(A,B,C)),1)
|
||||
\endverbatim</PRE>
|
||||
</PRE>
|
||||
|
||||
expands to B.
|
||||
<P>expands to B.</P>
|
||||
|
||||
<H3>Uses</H3>
|
||||
- BOOST_PP_WHILE()
|
||||
<UL>
|
||||
<LI>BOOST_PP_WHILE()
|
||||
</UL>
|
||||
*/
|
||||
#define BOOST_PP_LIST_AT(L,I) BOOST_PP_LIST_AT_D(0,L,I)
|
||||
|
||||
|
@ -13,26 +13,23 @@
|
||||
* See http://www.boost.org for most recent version.
|
||||
*/
|
||||
|
||||
/** \file
|
||||
|
||||
<a href="../../../../boost/preprocessor/list/cat.hpp">Click here to see the header.</a>
|
||||
*/
|
||||
|
||||
#include <boost/preprocessor/cat.hpp>
|
||||
#include <boost/preprocessor/list/fold_left.hpp>
|
||||
|
||||
/** Catenates all elements of the list.
|
||||
/** <P>Catenates all elements of the list.</P>
|
||||
|
||||
For example,
|
||||
<P>For example,</P>
|
||||
|
||||
<PRE>\verbatim
|
||||
<PRE>
|
||||
BOOST_PP_LIST_CAT(BOOST_PP_TUPLE_TO_LIST(3,(1,2,3)))
|
||||
\endverbatim</PRE>
|
||||
</PRE>
|
||||
|
||||
expands to 123.
|
||||
<P>expands to 123.</P>
|
||||
|
||||
<H3>Uses</H3>
|
||||
- BOOST_PP_WHILE()
|
||||
<UL>
|
||||
<LI>BOOST_PP_WHILE()
|
||||
</UL>
|
||||
*/
|
||||
#define BOOST_PP_LIST_CAT(L) BOOST_PP_LIST_CAT_D(0,L)
|
||||
|
||||
|
@ -13,30 +13,27 @@
|
||||
* See http://www.boost.org for most recent version.
|
||||
*/
|
||||
|
||||
/** \file
|
||||
|
||||
<a href="../../../../boost/preprocessor/list/enum.hpp">Click here to see the header.</a>
|
||||
*/
|
||||
|
||||
#include <boost/preprocessor/comma_if.hpp>
|
||||
#include <boost/preprocessor/list/for_each.hpp>
|
||||
|
||||
/** Converts the list to a comma separated list.
|
||||
/** <P>Converts the list to a comma separated list.</P>
|
||||
|
||||
For example,
|
||||
<P>For example,</P>
|
||||
|
||||
<PRE>\verbatim
|
||||
<PRE>
|
||||
BOOST_PP_LIST_ENUM(BOOST_PP_TUPLE_TO_LIST(3,(A,B,C)))
|
||||
\endverbatim</PRE>
|
||||
</PRE>
|
||||
|
||||
expands to:
|
||||
<P>expands to:</P>
|
||||
|
||||
<PRE>\verbatim
|
||||
<PRE>
|
||||
A, B, C
|
||||
\endverbatim</PRE>
|
||||
</PRE>
|
||||
|
||||
<H3>Uses</H3>
|
||||
- BOOST_PP_FOR().
|
||||
<UL>
|
||||
<LI>BOOST_PP_FOR()
|
||||
</UL>
|
||||
*/
|
||||
#define BOOST_PP_LIST_ENUM(L) BOOST_PP_LIST_ENUM_R(0,L)
|
||||
|
||||
|
@ -13,25 +13,22 @@
|
||||
* See http://www.boost.org for most recent version.
|
||||
*/
|
||||
|
||||
/** \file
|
||||
|
||||
<a href="../../../../boost/preprocessor/list/filter.hpp">Click here to see the header.</a>
|
||||
*/
|
||||
|
||||
#include <boost/preprocessor/list/fold_right.hpp>
|
||||
|
||||
/** Expands to a list containing all the elements X of the list for which F(D,P,X) is true.
|
||||
/** <P>Expands to a list containing all the elements X of the list for which F(D,P,X) is true.</P>
|
||||
|
||||
For example,
|
||||
<P>For example,</P>
|
||||
|
||||
<PRE>\verbatim
|
||||
<PRE>
|
||||
BOOST_PP_LIST_FILTER(BOOST_PP_NOT_EQUAL_D,2,BOOST_PP_TUPLE_TO_LIST(3,(1,2,3)))
|
||||
\endverbatim</PRE>
|
||||
</PRE>
|
||||
|
||||
expands to a list containing 1 and 3.
|
||||
<P>expands to a list containing 1 and 3.</P>
|
||||
|
||||
<H3>Uses</H3>
|
||||
- BOOST_PP_WHILE()
|
||||
<UL>
|
||||
<LI>BOOST_PP_WHILE()
|
||||
</UL>
|
||||
*/
|
||||
#define BOOST_PP_LIST_FILTER(F,P,L) BOOST_PP_LIST_FILTER_D(0,F,P,L)
|
||||
|
||||
|
@ -13,27 +13,24 @@
|
||||
* See http://www.boost.org for most recent version.
|
||||
*/
|
||||
|
||||
/** \file
|
||||
|
||||
<a href="../../../../boost/preprocessor/list/first_n.hpp">Click here to see the header.</a>
|
||||
*/
|
||||
|
||||
#include <boost/preprocessor/dec.hpp>
|
||||
#include <boost/preprocessor/list/adt.hpp>
|
||||
#include <boost/preprocessor/while.hpp>
|
||||
|
||||
/** Expands to a list of the first N elements of the list.
|
||||
/** <P>Expands to a list of the first N elements of the list.</P>
|
||||
|
||||
For example,
|
||||
<P>For example,</P>
|
||||
|
||||
<PRE>\verbatim
|
||||
<PRE>
|
||||
BOOST_PP_LIST_FIRST_N(2,BOOST_PP_TUPLE_TO_LIST(4,(+,-,*,/)))
|
||||
\endverbatim</PRE>
|
||||
</PRE>
|
||||
|
||||
expands to a list containing + and -.
|
||||
<P>expands to a list containing + and -.</P>
|
||||
|
||||
<H3>Uses</H3>
|
||||
- BOOST_PP_WHILE()
|
||||
<UL>
|
||||
<LI>BOOST_PP_WHILE()
|
||||
</UL>
|
||||
*/
|
||||
#define BOOST_PP_LIST_FIRST_N(N,L) BOOST_PP_LIST_FIRST_N_D(0,N,L)
|
||||
|
||||
|
@ -13,40 +13,39 @@
|
||||
* See http://www.boost.org for most recent version.
|
||||
*/
|
||||
|
||||
/** \file
|
||||
|
||||
<a href="../../../../boost/preprocessor/list/fold_left.hpp">Click here to see the header.</a>
|
||||
*/
|
||||
|
||||
#include <boost/preprocessor/list/adt.hpp>
|
||||
#include <boost/preprocessor/while.hpp>
|
||||
|
||||
/** Iterates F(D,P,X) for each element X of the list L (from the left or the start of the list).
|
||||
/** <P>Iterates F(D,P,X) for each element X of the list L (from the left or the start of the list).</P>
|
||||
|
||||
In other words,
|
||||
<P>In other words,</P>
|
||||
|
||||
<PRE>\verbatim
|
||||
<PRE>
|
||||
BOOST_PP_LIST_FOLD_LEFT(F,P,L)
|
||||
\endverbatim</PRE>
|
||||
</PRE>
|
||||
|
||||
expands to:
|
||||
<P>expands to:</P>
|
||||
|
||||
<PRE>\verbatim
|
||||
<PRE>
|
||||
F
|
||||
( D
|
||||
, ... F(D, F(D,P,BOOST_PP_LIST_AT(L,0)), BOOST_PP_LIST_AT(L,1)) ...
|
||||
, BOOST_PP_LIST_AT(L,BOOST_PP_DEC(BOOST_PP_LIST_SIZE(L))
|
||||
)
|
||||
\endverbatim</PRE>
|
||||
</PRE>
|
||||
|
||||
Note that folding, or accumulation, is a very general pattern of computation.
|
||||
Most list operations can be implemented in terms of folding.
|
||||
<P>Note that folding, or accumulation, is a very general pattern of computation.
|
||||
Most list operations can be implemented in terms of folding.</P>
|
||||
|
||||
<H3>See</H3>
|
||||
- BOOST_PP_LIST_FOLD_RIGHT()
|
||||
<UL>
|
||||
<LI>BOOST_PP_LIST_FOLD_RIGHT()
|
||||
</UL>
|
||||
|
||||
<H3>Uses</H3>
|
||||
- BOOST_PP_WHILE()
|
||||
<UL>
|
||||
<LI>BOOST_PP_WHILE()
|
||||
</UL>
|
||||
*/
|
||||
#define BOOST_PP_LIST_FOLD_LEFT(F,P,L) BOOST_PP_LIST_FOLD_LEFT_D(0,F,P,L)
|
||||
|
||||
|
@ -13,24 +13,19 @@
|
||||
* See http://www.boost.org for most recent version.
|
||||
*/
|
||||
|
||||
/** \file
|
||||
|
||||
<a href="../../../../boost/preprocessor/list/fold_right.hpp">Click here to see the header.</a>
|
||||
*/
|
||||
|
||||
#include <boost/preprocessor/list/reverse.hpp>
|
||||
|
||||
/** Iterates F(D,X,P) for each element X of the list L (from the right or the end of the list).
|
||||
/** <P>Iterates F(D,X,P) for each element X of the list L (from the right or the end of the list).</P>
|
||||
|
||||
In other words,
|
||||
<P>In other words,</P>
|
||||
|
||||
<PRE>\verbatim
|
||||
<PRE>
|
||||
BOOST_PP_LIST_FOLD_RIGHT(F,L,P)
|
||||
\endverbatim</PRE>
|
||||
</PRE>
|
||||
|
||||
expands to:
|
||||
<P>expands to:</P>
|
||||
|
||||
<PRE>\verbatim
|
||||
<PRE>
|
||||
F
|
||||
( D
|
||||
, BOOST_PP_LIST_AT(L,0)
|
||||
@ -44,13 +39,17 @@ expands to:
|
||||
)
|
||||
) ...
|
||||
)
|
||||
\endverbatim</PRE>
|
||||
</PRE>
|
||||
|
||||
<H3>See</H3>
|
||||
- BOOST_PP_LIST_FOLD_LEFT()
|
||||
<UL>
|
||||
<LI>BOOST_PP_LIST_FOLD_LEFT()
|
||||
</UL>
|
||||
|
||||
<H3>Uses</H3>
|
||||
- BOOST_PP_WHILE()
|
||||
<UL>
|
||||
<LI>BOOST_PP_WHILE()
|
||||
</UL>
|
||||
*/
|
||||
#define BOOST_PP_LIST_FOLD_RIGHT(F,L,P) BOOST_PP_LIST_FOLD_RIGHT_D(0,F,L,P)
|
||||
|
||||
|
@ -13,30 +13,29 @@
|
||||
* See http://www.boost.org for most recent version.
|
||||
*/
|
||||
|
||||
/** \file
|
||||
|
||||
<a href="../../../../boost/preprocessor/list/for_each.hpp">Click here to see the header.</a>
|
||||
*/
|
||||
|
||||
#include <boost/preprocessor/list/adt.hpp>
|
||||
#include <boost/preprocessor/for.hpp>
|
||||
|
||||
/** Repeats F(R,P,BOOST_PP_LIST_AT(L,I)) for each I = [0,BOOST_PP_LIST_SIZE(L)[.
|
||||
/** <P>Repeats F(R,P,BOOST_PP_LIST_AT(L,I)) for each I = [0,BOOST_PP_LIST_SIZE(L)[.</P>
|
||||
|
||||
In other words, expands to the sequence:
|
||||
<P>In other words, expands to the sequence:</P>
|
||||
|
||||
<PRE>\verbatim
|
||||
<PRE>
|
||||
F(R,P,BOOST_PP_LIST_AT(L,0))
|
||||
F(R,P,BOOST_PP_LIST_AT(L,1))
|
||||
...
|
||||
F(R,P,BOOST_PP_LIST_AT(L,BOOST_PP_DEC(BOOST_PP_LIST_SIZE(L))))
|
||||
\endverbatim</PRE>
|
||||
</PRE>
|
||||
|
||||
<H3>Example</H3>
|
||||
- <a href="../../example/catch_builtin.cpp">catch_builtin.cpp</a>
|
||||
<UL>
|
||||
<LI><a href="../../example/catch_builtin.cpp">catch_builtin.cpp</a>
|
||||
</UL>
|
||||
|
||||
<H3>Uses</H3>
|
||||
- BOOST_PP_FOR()
|
||||
<UL>
|
||||
<LI>BOOST_PP_FOR()
|
||||
</UL>
|
||||
*/
|
||||
#define BOOST_PP_LIST_FOR_EACH(F,P,L) BOOST_PP_LIST_FOR_EACH_R(0,F,P,L)
|
||||
|
||||
|
@ -13,30 +13,30 @@
|
||||
* See http://www.boost.org for most recent version.
|
||||
*/
|
||||
|
||||
/** \file
|
||||
|
||||
<a href="../../../../boost/preprocessor/list/for_each_product.hpp">Click here to see the header.</a>
|
||||
*/
|
||||
|
||||
#include <boost/preprocessor/list/adt.hpp>
|
||||
#include <boost/preprocessor/for.hpp>
|
||||
|
||||
/** THIS IS NOT YET FULLY DOCUMENTED - DO NOT USE!
|
||||
/** <H3>THIS IS NOT YET FULLY DOCUMENTED - DO NOT USE!</H3>
|
||||
|
||||
Repeats F(R,P,X) for each element X of the cartesian product of the lists LL.
|
||||
<P>Repeats F(R,P,X) for each element X of the cartesian product of the lists LL.</P>
|
||||
|
||||
This macro is useful for generating code to avoid combinatorial explosion.
|
||||
<P>This macro is useful for generating code to avoid combinatorial explosion.</P>
|
||||
|
||||
<B>LL</B> is a list of lists.
|
||||
|
||||
<B>X</B> is an element of the cartesian product of the lists LL.
|
||||
<UL>
|
||||
<LI><B>LL</B> is a list of lists.
|
||||
<LI><B>X</B> is an element of the cartesian product of the lists LL.
|
||||
</UL>
|
||||
|
||||
<H3>Example</H3>
|
||||
- <a href="../../example/is_integral.cpp">is_integral.cpp</a>
|
||||
- <a href="../../example/array_arithmetic.c">array_arithmetic.c</a>
|
||||
<UL>
|
||||
<LI><a href="../../example/is_integral.cpp">is_integral.cpp</a>
|
||||
<LI><a href="../../example/array_arithmetic.c">array_arithmetic.c</a>
|
||||
</UL>
|
||||
|
||||
<H3>Uses</H3>
|
||||
- BOOST_PP_FOR()
|
||||
<UL>
|
||||
<LI>BOOST_PP_FOR()
|
||||
</UL>
|
||||
*/
|
||||
#define BOOST_PP_LIST_FOR_EACH_PRODUCT(F,P,LL) BOOST_PP_LIST_FOR_EACH_PRODUCT_R(0,F,P,LL)
|
||||
|
||||
|
@ -13,27 +13,24 @@
|
||||
* See http://www.boost.org for most recent version.
|
||||
*/
|
||||
|
||||
/** \file
|
||||
|
||||
<a href="../../../../boost/preprocessor/list/rest_n.hpp">Click here to see the header.</a>
|
||||
*/
|
||||
|
||||
#include <boost/preprocessor/dec.hpp>
|
||||
#include <boost/preprocessor/list/adt.hpp>
|
||||
#include <boost/preprocessor/while.hpp>
|
||||
|
||||
/** Expands to a list of all but the first N elements of the list.
|
||||
/** <P>Expands to a list of all but the first N elements of the list.</P>
|
||||
|
||||
For example,
|
||||
<P>For example,</P>
|
||||
|
||||
<PRE>\verbatim
|
||||
<PRE>
|
||||
BOOST_PP_LIST_REST_N(2,BOOST_PP_TUPLE_TO_LIST(4,(+,-,*,/)))
|
||||
\endverbatim</PRE>
|
||||
</PRE>
|
||||
|
||||
expands to a list containing * and /.
|
||||
<P>expands to a list containing * and /.</P>
|
||||
|
||||
<H3>Uses</H3>
|
||||
- BOOST_PP_WHILE()
|
||||
<UL>
|
||||
<LI>BOOST_PP_WHILE()
|
||||
</UL>
|
||||
*/
|
||||
#define BOOST_PP_LIST_REST_N(N,L) BOOST_PP_LIST_REST_N_D(0,N,L)
|
||||
|
||||
|
@ -13,25 +13,22 @@
|
||||
* See http://www.boost.org for most recent version.
|
||||
*/
|
||||
|
||||
/** \file
|
||||
|
||||
<a href="../../../../boost/preprocessor/list/reverse.hpp">Click here to see the header.</a>
|
||||
*/
|
||||
|
||||
#include <boost/preprocessor/list/fold_left.hpp>
|
||||
|
||||
/** List reversal.
|
||||
/** <P>List reversal.</P>
|
||||
|
||||
For example,
|
||||
<P>For example,</P>
|
||||
|
||||
<PRE>\verbatim
|
||||
<PRE>
|
||||
BOOST_PP_LIST_REVERSE(BOOST_PP_TUPLE_TO_LIST(3,(A,B,C)))
|
||||
\endverbatim</PRE>
|
||||
</PRE>
|
||||
|
||||
expands to a list containing C, B and A.
|
||||
<P>expands to a list containing C, B and A.</P>
|
||||
|
||||
<H3>Uses</H3>
|
||||
- BOOST_PP_WHILE()
|
||||
<UL>
|
||||
<LI>BOOST_PP_WHILE()
|
||||
</UL>
|
||||
*/
|
||||
#define BOOST_PP_LIST_REVERSE(L) BOOST_PP_LIST_REVERSE_D(0,L)
|
||||
|
||||
|
@ -13,26 +13,23 @@
|
||||
* See http://www.boost.org for most recent version.
|
||||
*/
|
||||
|
||||
/** \file
|
||||
|
||||
<a href="../../../../boost/preprocessor/list/size.hpp">Click here to see the header.</a>
|
||||
*/
|
||||
|
||||
#include <boost/preprocessor/list/fold_left.hpp>
|
||||
#include <boost/preprocessor/inc.hpp>
|
||||
|
||||
/** Expands to the number of elements in the list.
|
||||
/** <P>Expands to the number of elements in the list.</P>
|
||||
|
||||
For example,
|
||||
<P>For example,</P>
|
||||
|
||||
<PRE>\verbatim
|
||||
<PRE>
|
||||
BOOST_PP_LIST_SIZE(BOOST_PP_TUPLE_TO_LIST(3,(A,B,C)))
|
||||
\endverbatim</PRE>
|
||||
</PRE>
|
||||
|
||||
expands to 3.
|
||||
<P>expands to 3.</P>
|
||||
|
||||
<H3>Uses</H3>
|
||||
- BOOST_PP_WHILE()
|
||||
<UL>
|
||||
<LI>BOOST_PP_WHILE()
|
||||
</UL>
|
||||
*/
|
||||
#define BOOST_PP_LIST_SIZE(L) BOOST_PP_LIST_SIZE_D(0,L)
|
||||
|
||||
|
@ -13,29 +13,26 @@
|
||||
* See http://www.boost.org for most recent version.
|
||||
*/
|
||||
|
||||
/** \file
|
||||
|
||||
<a href="../../../../boost/preprocessor/list/to_tuple.hpp">Click here to see the header.</a>
|
||||
*/
|
||||
|
||||
#include <boost/preprocessor/comma_if.hpp>
|
||||
#include <boost/preprocessor/list/enum.hpp>
|
||||
|
||||
/** Converts the list to a tuple.
|
||||
/** <P>Converts the list to a tuple.</P>
|
||||
|
||||
For example,
|
||||
<P>For example,</P>
|
||||
|
||||
<PRE>\verbatim
|
||||
<PRE>
|
||||
BOOST_PP_LIST_TO_TUPLE(BOOST_PP_TUPLE_TO_LIST(3,(A,B,C)))
|
||||
\endverbatim</PRE>
|
||||
</PRE>
|
||||
|
||||
expands to (A,B,C).
|
||||
<P>expands to (A,B,C).</P>
|
||||
|
||||
NOTE: The supported size of the list being converted to a tuple is limited by
|
||||
BOOST_PP_LIMIT_MAG rather than BOOST_PP_LIMIT_TUPLE.
|
||||
<P>NOTE: The supported size of the list being converted to a tuple is limited by
|
||||
BOOST_PP_LIMIT_MAG rather than BOOST_PP_LIMIT_TUPLE.</P>
|
||||
|
||||
<H3>Uses</H3>
|
||||
- BOOST_PP_FOR()
|
||||
<UL>
|
||||
<LI>BOOST_PP_FOR()
|
||||
</UL>
|
||||
*/
|
||||
#define BOOST_PP_LIST_TO_TUPLE(L) BOOST_PP_LIST_TO_TUPLE_R(0,L)
|
||||
|
||||
|
@ -13,35 +13,32 @@
|
||||
* See http://www.boost.org for most recent version.
|
||||
*/
|
||||
|
||||
/** \file
|
||||
|
||||
<a href="../../../../boost/preprocessor/list/transform.hpp">Click here to see the header.</a>
|
||||
*/
|
||||
|
||||
#include <boost/preprocessor/list/fold_right.hpp>
|
||||
|
||||
/** Applies the macro F(D,P,X) to each element X of the list producing a new list.
|
||||
/** <P>Applies the macro F(D,P,X) to each element X of the list producing a new list.</P>
|
||||
|
||||
In other words, BOOST_PP_LIST_TRANSFORM(F,P,L) expands to same as:
|
||||
<P>In other words, BOOST_PP_LIST_TRANSFORM(F,P,L) expands to same as:</P>
|
||||
|
||||
<PRE>\verbatim
|
||||
<PRE>
|
||||
BOOST_PP_LIST_CONS(F(D,P,BOOST_PP_LIST_AT(L,0)),
|
||||
BOOST_PP_LIST_CONS(F(D,P,BOOST_PP_LIST_AT(L,1)),
|
||||
...
|
||||
BOOST_PP_LIST_CONS(F(D,P,BOOST_PP_LIST_AT(L,BOOST_PP_DEC(BOOST_PP_LIST_SIZE(L)))),
|
||||
BOOST_PP_LIST_NIL) ... ))
|
||||
\endverbatim</PRE>
|
||||
</PRE>
|
||||
|
||||
For example,
|
||||
<P>For example,</P>
|
||||
|
||||
<PRE>\verbatim
|
||||
<PRE>
|
||||
BOOST_PP_LIST_TRANSFORM(BOOST_PP_ADD_D,2,BOOST_PP_TUPLE_TO_LIST(2,(1,2)))
|
||||
\endverbatim</PRE>
|
||||
</PRE>
|
||||
|
||||
expands to a list containing 3 and 4.
|
||||
<P>expands to a list containing 3 and 4.</P>
|
||||
|
||||
<H3>Uses</H3>
|
||||
- BOOST_PP_WHILE()
|
||||
<UL>
|
||||
<LI>BOOST_PP_WHILE()
|
||||
</UL>
|
||||
*/
|
||||
#define BOOST_PP_LIST_TRANSFORM(F,P,L) BOOST_PP_LIST_TRANSFORM_D(0,F,P,L)
|
||||
|
||||
|
Reference in New Issue
Block a user