Updated docs

[SVN r12687]
This commit is contained in:
Vesa Karvonen
2002-02-04 13:32:28 +00:00
parent 6fa0d837a3
commit 8432192ac0
66 changed files with 627 additions and 712 deletions

View File

@ -13,69 +13,71 @@
* See http://www.boost.org for most recent version.
*/
/** <P>This header defines the fundamental list operations.</P>
/** <p>This header defines the fundamental list operations.</p>
<H3>Note</H3>
<UL>
<LI>The internal representation of lists is hidden. Although there aren't
<h3>Note</h3>
<ul>
<li>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>
</UL>
writing code that depends on the internal representation details.</li>
</ul>
*/
#include <boost/preprocessor/tuple/elem.hpp>
#include <boost/preprocessor/logical/not.hpp>
/** <P>List constructor.</P>
/** <p>List constructor.</p>
<P>Lists are build using list constructors BOOST_PP_LIST_NIL and
BOOST_PP_LIST_CONS(). For example,</P>
<p>Lists are build using list constructors BOOST_PP_LIST_NIL and
BOOST_PP_LIST_CONS(). For example,</p>
<PRE>
<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)))))
</PRE>
</pre>
<P>Short lists can also be build from tuples:</P>
<p>Short lists can also be build from tuples:</p>
<PRE>
<pre>
BOOST_PP_TUPLE_TO_LIST(5,(1,2,3,4,5))
</PRE>
</pre>
<P>Both of the above lists contain 5 elements: 1, 2, 3, 4 and 5.</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>
*/
#define BOOST_PP_LIST_CONS(H,T) (H,T,1)
/** <P>List nil constructor.</P> */
/** <p>List nil constructor.</p> */
#define BOOST_PP_LIST_NIL (_,_,0)
/** <P>Expands to 1 if the list is not nil and 0 otherwise.</P> */
/** <p>Expands to 1 if the list is not nil and 0 otherwise.</p> */
#if !defined(BOOST_NO_COMPILER_CONFIG) && defined(__MWERKS__) && __MWERKS__ <= 0x2406
# define BOOST_PP_LIST_IS_CONS(L) BOOST_PP_TUPLE_ELEM(3,2,L)
#else
# define BOOST_PP_LIST_IS_CONS(L) BOOST_PP_TUPLE3_ELEM2 L
#endif
/** <P>Expands to 1 if the list is nil and 0 otherwise.</P> */
/** <p>Expands to 1 if the list is nil and 0 otherwise.</p> */
#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))
#else
# define BOOST_PP_LIST_IS_NIL(L) BOOST_PP_NOT(BOOST_PP_TUPLE3_ELEM2 L)
#endif
/** <P>Expands to the first element of the list. The list must not be nil.</P>
/** <p>Expands to the first element of the list. The list must not be nil.</p>
<P>For example,</P>
<p>For example,</p>
<PRE>
<pre>
BOOST_PP_LIST_FIRST(BOOST_PP_TUPLE_TO_LIST(5,(1,2,3,4,5)))
</PRE>
</pre>
<P>expands to 1.</P>
<p>expands to 1.</p>
*/
#if !defined(BOOST_NO_COMPILER_CONFIG) && defined(__MWERKS__) && __MWERKS__ <= 0x2406
# define BOOST_PP_LIST_FIRST(L) BOOST_PP_TUPLE_ELEM(3,0,L)
@ -83,15 +85,21 @@ BOOST_PP_LIST_CONS(). For example,</P>
# define BOOST_PP_LIST_FIRST(L) BOOST_PP_TUPLE3_ELEM0 L
#endif
/** <P>Expands to a list of all but the first element of the list. The list must not be nil.</P>
/** <p>Expands to a list of all but the first element of the list.</p>
<P>For example,</P>
<p>The list must not be nil.</p>
<PRE>
<p>For example,</p>
<pre>
BOOST_PP_LIST_REST(BOOST_PP_TUPLE_TO_LIST(5,(1,2,3,4,5)))
</PRE>
</pre>
<P>expands to a list containing 2, 3, 4 and 5.</P>
<p>expands to the same as:</p>
<pre>
BOOST_PP_TUPLE_TO_LIST(4,(2,3,4,5))
</pre>
*/
#if !defined(BOOST_NO_COMPILER_CONFIG) && defined(__MWERKS__) && __MWERKS__ <= 0x2406
# define BOOST_PP_LIST_REST(L) BOOST_PP_TUPLE_ELEM(3,1,L)

View File

@ -15,23 +15,27 @@
#include <boost/preprocessor/list/fold_right.hpp>
/** <P>Catenates two lists together.</P>
/** <p>Catenates two lists together.</p>
<P>For example,</P>
<p>For example,</p>
<PRE>
<pre>
BOOST_PP_LIST_APPEND
( BOOST_PP_TUPLE_TO_LIST(2,(1,2))
, BOOST_PP_TUPLE_TO_LIST(2,(3,4))
)
</PRE>
</pre>
<P>produces a list containing 1, 2, 3 and 4.</P>
<p>expands to the same as:</p>
<H3>Uses</H3>
<UL>
<LI>BOOST_PP_WHILE()
</UL>
<pre>
BOOST_PP_TUPLE_TO_LIST(4,(1,2,3,4))
</pre>
<h3>Uses</h3>
<ul>
<li>BOOST_PP_LIST_FOLD_RIGHT()</li>
</ul>
*/
#define BOOST_PP_LIST_APPEND(L,P) BOOST_PP_LIST_APPEND_D(0,L,P)

View File

@ -15,20 +15,21 @@
#include <boost/preprocessor/list/rest_n.hpp>
/** <P>Expands to the I:th element of the list L. The first element is at index 0.</P>
/** <p>Expands to the <code>I</code>:th element of the list <code>L</code>. The
first element is at index <code>0</code>.</p>
<P>For example,</P>
<p>For example,</p>
<PRE>
<pre>
BOOST_PP_LIST_AT(BOOST_PP_TUPLE_TO_LIST(3,(A,B,C)),1)
</PRE>
</pre>
<P>expands to B.</P>
<p>expands to <code>B</code>.</p>
<H3>Uses</H3>
<UL>
<LI>BOOST_PP_WHILE()
</UL>
<h3>Uses</h3>
<ul>
<li>BOOST_PP_WHILE()</li>
</ul>
*/
#define BOOST_PP_LIST_AT(L,I) BOOST_PP_LIST_AT_D(0,L,I)

View File

@ -16,20 +16,24 @@
#include <boost/preprocessor/cat.hpp>
#include <boost/preprocessor/list/fold_left.hpp>
/** <P>Catenates all elements of the list.</P>
/** <p>Catenates all elements of the list.</p>
<P>For example,</P>
<p>For example,</p>
<PRE>
<pre>
BOOST_PP_LIST_CAT(BOOST_PP_TUPLE_TO_LIST(3,(1,2,3)))
</PRE>
</pre>
<P>expands to 123.</P>
<p>expands to:</p>
<H3>Uses</H3>
<UL>
<LI>BOOST_PP_WHILE()
</UL>
<pre>
123
</pre>
<h3>Uses</h3>
<ul>
<li>BOOST_PP_LIST_FOLD_LEFT()</li>
</ul>
*/
#define BOOST_PP_LIST_CAT(L) BOOST_PP_LIST_CAT_D(0,L)

View File

@ -16,24 +16,24 @@
#include <boost/preprocessor/comma_if.hpp>
#include <boost/preprocessor/list/for_each.hpp>
/** <P>Converts the list to a comma separated list.</P>
/** <p>Converts the list to a comma separated list.</p>
<P>For example,</P>
<p>For example,</p>
<PRE>
<pre>
BOOST_PP_LIST_ENUM(BOOST_PP_TUPLE_TO_LIST(3,(A,B,C)))
</PRE>
</pre>
<P>expands to:</P>
<p>expands to:</p>
<PRE>
A, B, C
</PRE>
<pre>
A,B,C
</pre>
<H3>Uses</H3>
<UL>
<LI>BOOST_PP_FOR()
</UL>
<h3>Uses</h3>
<ul>
<li>BOOST_PP_LIST_FOR_EACH()</li>
</ul>
*/
#define BOOST_PP_LIST_ENUM(L) BOOST_PP_LIST_ENUM_R(0,L)

View File

@ -15,20 +15,25 @@
#include <boost/preprocessor/list/fold_right.hpp>
/** <P>Expands to a list containing all the elements X of the list for which F(D,P,X) is true.</P>
/** <p>Expands to a list containing all the elements <code>X</code> of the list
for which <code>F(D,P,X)</code> is true.</p>
<P>For example,</P>
<p>For example,</p>
<PRE>
<pre>
BOOST_PP_LIST_FILTER(BOOST_PP_NOT_EQUAL_D,2,BOOST_PP_TUPLE_TO_LIST(3,(1,2,3)))
</PRE>
</pre>
<P>expands to a list containing 1 and 3.</P>
<p>expands to the same as:</p>
<H3>Uses</H3>
<UL>
<LI>BOOST_PP_WHILE()
</UL>
<pre>
BOOST_PP_TUPLE_TO_LIST(2,(1,3))
</pre>
<h3>Uses</h3>
<ul>
<li>BOOST_PP_LIST_FOLD_RIGHT()</li>
</ul>
*/
#define BOOST_PP_LIST_FILTER(F,P,L) BOOST_PP_LIST_FILTER_D(0,F,P,L)

View File

@ -17,20 +17,30 @@
#include <boost/preprocessor/list/adt.hpp>
#include <boost/preprocessor/while.hpp>
/** <P>Expands to a list of the first N elements of the list.</P>
/** <p>Expands to a list of the first <code>N</code> elements of the list
<code>L</code>.</p>
<P>For example,</P>
<p>For example,</p>
<PRE>
<pre>
BOOST_PP_LIST_FIRST_N(2,BOOST_PP_TUPLE_TO_LIST(4,(+,-,*,/)))
</PRE>
</pre>
<P>expands to a list containing + and -.</P>
<p>expands to the same as:</p>
<H3>Uses</H3>
<UL>
<LI>BOOST_PP_WHILE()
</UL>
<pre>
BOOST_PP_TUPLE_TO_LIST(2,(+,-))
</pre>
<h3>See</h3>
<ul>
<li>BOOST_PP_LIST_REST_N()</li>
</ul>
<h3>Uses</h3>
<ul>
<li>BOOST_PP_LIST_FOLD_LEFT()</li>
</ul>
*/
#define BOOST_PP_LIST_FIRST_N(N,L) BOOST_PP_LIST_FIRST_N_D(0,N,L)

View File

@ -16,39 +16,34 @@
#include <boost/preprocessor/list/adt.hpp>
#include <boost/preprocessor/while.hpp>
/** <P>Iterates F(D,P,X) for each element X of the list L (from the left or the start of the list).</P>
/** <p>Iterates <code>F(D,P,X)</code> for each element <code>X</code> of the
list <code>L</code> (from the left or the start of the list).</p>
<P>In other words,</P>
<p>In other words, expands to:</p>
<PRE>
BOOST_PP_LIST_FOLD_LEFT(F,P,L)
</PRE>
<P>expands to:</P>
<PRE>
<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))
)
</PRE>
</pre>
<H3>Note</H3>
<UL>
<LI>Folding, or accumulation, is a very general pattern of computation.
Most list operations can be implemented in terms of folding.
</UL>
<h3>Note</h3>
<ul>
<li>Folding, or accumulation, is a very general pattern of computation.
Most list operations can be implemented in terms of folding.</li>
</ul>
<H3>See</H3>
<UL>
<LI>BOOST_PP_LIST_FOLD_RIGHT()
</UL>
<h3>See</h3>
<ul>
<li>BOOST_PP_LIST_FOLD_RIGHT()</li>
</ul>
<H3>Uses</H3>
<UL>
<LI>BOOST_PP_WHILE()
</UL>
<h3>Uses</h3>
<ul>
<li>BOOST_PP_WHILE()</li>
</ul>
*/
#define BOOST_PP_LIST_FOLD_LEFT(F,P,L) BOOST_PP_LIST_FOLD_LEFT_D(0,F,P,L)

View File

@ -15,17 +15,12 @@
#include <boost/preprocessor/list/reverse.hpp>
/** <P>Iterates F(D,X,P) for each element X of the list L (from the right or the end of the list).</P>
/** <p>Iterates <code>F(D,X,P)</code> for each element <code>X</code> of the
list <code>L</code> (from the right or the end of the list).</p>
<P>In other words,</P>
<p>In other words, expands to:</p>
<PRE>
BOOST_PP_LIST_FOLD_RIGHT(F,L,P)
</PRE>
<P>expands to:</P>
<PRE>
<pre>
F
( D
, BOOST_PP_LIST_AT(L,0)
@ -39,17 +34,12 @@
)
) ...
)
</PRE>
</pre>
<H3>See</H3>
<UL>
<LI>BOOST_PP_LIST_FOLD_LEFT()
</UL>
<H3>Uses</H3>
<UL>
<LI>BOOST_PP_WHILE()
</UL>
<h3>Uses</h3>
<ul>
<li>BOOST_PP_LIST_FOLD_LEFT()</li>
</ul>
*/
#define BOOST_PP_LIST_FOLD_RIGHT(F,L,P) BOOST_PP_LIST_FOLD_RIGHT_D(0,F,L,P)

View File

@ -16,26 +16,27 @@
#include <boost/preprocessor/list/adt.hpp>
#include <boost/preprocessor/for.hpp>
/** <P>Repeats F(R,P,BOOST_PP_LIST_AT(L,I)) for each I = [0,BOOST_PP_LIST_SIZE(L)[.</P>
/** <p>Repeats <code>F(R,P,BOOST_PP_LIST_AT(L,I))</code> for each I = [0,
BOOST_PP_LIST_SIZE(L)[.</p>
<P>In other words, expands to the sequence:</P>
<p>In other words, expands to the sequence:</p>
<PRE>
<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))))
</PRE>
</pre>
<H3>Example</H3>
<UL>
<LI><a href="../../example/catch_builtin.cpp">catch_builtin.cpp</a>
</UL>
<h3>Example</h3>
<ul>
<li><a href="../../example/catch_builtin.cpp">catch_builtin.cpp</a></li>
</ul>
<H3>Uses</H3>
<UL>
<LI>BOOST_PP_FOR()
</UL>
<h3>Uses</h3>
<ul>
<li>BOOST_PP_FOR()</li>
</ul>
*/
#define BOOST_PP_LIST_FOR_EACH(F,P,L) BOOST_PP_LIST_FOR_EACH_R(0,F,P,L)

View File

@ -16,29 +16,31 @@
#include <boost/preprocessor/list/adt.hpp>
#include <boost/preprocessor/for.hpp>
/** <H3>THIS IS NOT YET FULLY DOCUMENTED - DO NOT USE!</H3>
/** <h3>THIS IS NOT YET FULLY DOCUMENTED - DO NOT USE!</h3>
<P>Repeats F(R,P,X) for each element X of the cartesian product of the lists LL.</P>
<p>Repeats <code>F(R,P,X)</code> for each element <code>X</code> of the
cartesian product of the lists <code>LL</code>.</p>
<P>This macro is useful for generating code to avoid combinatorial explosion.</P>
<p>This macro is useful for generating code to avoid combinatorial
explosion.</p>
<H3>Legend</H3>
<UL>
<LI><B>LL</B> is a list of lists.
<LI><B>X</B> is a list of the elements of an element of the cartesian product of
the lists LL.
</UL>
<h3>Legend</h3>
<ul>
<li><b>LL</b> is a list of lists.</li>
<li><b>X</b> is a list of the elements of an element of the cartesian product
of the lists LL.</li>
</ul>
<H3>Example</H3>
<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>Example</h3>
<ul>
<li><a href="../../example/is_integral.cpp">is_integral.cpp</a></li>
<li><a href="../../example/array_arithmetic.c">array_arithmetic.c</a></li>
</ul>
<H3>Uses</H3>
<UL>
<LI>BOOST_PP_FOR()
</UL>
<h3>Uses</h3>
<ul>
<li>BOOST_PP_FOR()</li>
</ul>
*/
#define BOOST_PP_LIST_FOR_EACH_PRODUCT(F,P,LL) BOOST_PP_LIST_FOR_EACH_PRODUCT_R(0,F,P,LL)

View File

@ -17,20 +17,30 @@
#include <boost/preprocessor/list/adt.hpp>
#include <boost/preprocessor/while.hpp>
/** <P>Expands to a list of all but the first N elements of the list.</P>
/** <p>Expands to a list of all but the first <code>N</code> elements of the
list <code>L</code>.</p>
<P>For example,</P>
<p>For example,</p>
<PRE>
<pre>
BOOST_PP_LIST_REST_N(2,BOOST_PP_TUPLE_TO_LIST(4,(+,-,*,/)))
</PRE>
</pre>
<P>expands to a list containing * and /.</P>
<p>expands to the same as:</p>
<H3>Uses</H3>
<UL>
<LI>BOOST_PP_WHILE()
</UL>
<pre>
BOOST_PP_TUPLE_TO_LIST(2,(*,/))
</pre>
<h3>See</h3>
<ul>
<li>BOOST_PP_LIST_FIRST_N()</li>
</ul>
<h3>Uses</h3>
<ul>
<li>BOOST_PP_WHILE()</li>
</ul>
*/
#define BOOST_PP_LIST_REST_N(N,L) BOOST_PP_LIST_REST_N_D(0,N,L)

View File

@ -15,20 +15,24 @@
#include <boost/preprocessor/list/fold_left.hpp>
/** <P>List reversal.</P>
/** <p>List reversal.</p>
<P>For example,</P>
<p>For example,</p>
<PRE>
<pre>
BOOST_PP_LIST_REVERSE(BOOST_PP_TUPLE_TO_LIST(3,(A,B,C)))
</PRE>
</pre>
<P>expands to a list containing C, B and A.</P>
<p>expands to the same as:</p>
<H3>Uses</H3>
<UL>
<LI>BOOST_PP_WHILE()
</UL>
<pre>
BOOST_PP_TUPLE_TO_LIST(3,(C,B,A))
</pre>
<h3>Uses</h3>
<ul>
<li>BOOST_PP_LIST_FOLD_LEFT()</li>
</ul>
*/
#define BOOST_PP_LIST_REVERSE(L) BOOST_PP_LIST_REVERSE_D(0,L)

View File

@ -16,20 +16,20 @@
#include <boost/preprocessor/list/fold_left.hpp>
#include <boost/preprocessor/inc.hpp>
/** <P>Expands to the number of elements in the list.</P>
/** <p>Expands to the number of elements in the list.</p>
<P>For example,</P>
<p>For example,</p>
<PRE>
<pre>
BOOST_PP_LIST_SIZE(BOOST_PP_TUPLE_TO_LIST(3,(A,B,C)))
</PRE>
</pre>
<P>expands to 3.</P>
<p>expands to <code>3</code>.</p>
<H3>Uses</H3>
<UL>
<LI>BOOST_PP_WHILE()
</UL>
<h3>Uses</h3>
<ul>
<li>BOOST_PP_LIST_FOLD_LEFT()</li>
</ul>
*/
#define BOOST_PP_LIST_SIZE(L) BOOST_PP_LIST_SIZE_D(0,L)

View File

@ -16,26 +16,26 @@
#include <boost/preprocessor/comma_if.hpp>
#include <boost/preprocessor/list/enum.hpp>
/** <P>Converts the list to a tuple.</P>
/** <p>Converts the list to a tuple.</p>
<P>For example,</P>
<p>For example,</p>
<PRE>
<pre>
BOOST_PP_LIST_TO_TUPLE(BOOST_PP_TUPLE_TO_LIST(3,(A,B,C)))
</PRE>
</pre>
<P>expands to (A,B,C).</P>
<p>expands to <code>(A,B,C)</code>.</p>
<H3>Note</H3>
<UL>
<LI>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>
</UL>
<h3>Note</h3>
<ul>
<li>The supported size of the list being converted to a tuple is limited by
BOOST_PP_LIMIT_MAG rather than BOOST_PP_LIMIT_TUPLE.</li>
</ul>
<H3>Uses</H3>
<UL>
<LI>BOOST_PP_FOR()
</UL>
<h3>Uses</h3>
<ul>
<li>BOOST_PP_LIST_FOR_EACH()</li>
</ul>
*/
#define BOOST_PP_LIST_TO_TUPLE(L) BOOST_PP_LIST_TO_TUPLE_R(0,L)

View File

@ -15,30 +15,35 @@
#include <boost/preprocessor/list/fold_right.hpp>
/** <P>Applies the macro F(D,P,X) to each element X of the list producing a new list.</P>
/** <p>Applies the macro <code>F(D,P,X)</code> to each element <code>X</code>
of the list producing a new list.</p>
<P>In other words, BOOST_PP_LIST_TRANSFORM(F,P,L) expands to same as:</P>
<p>In other words, expands to:</p>
<PRE>
<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) ... ))
</PRE>
</pre>
<P>For example,</P>
<p>For example,</p>
<PRE>
<pre>
BOOST_PP_LIST_TRANSFORM(BOOST_PP_ADD_D,2,BOOST_PP_TUPLE_TO_LIST(2,(1,2)))
</PRE>
</pre>
<P>expands to a list containing 3 and 4.</P>
<p>expands to the same as:</p>
<H3>Uses</H3>
<UL>
<LI>BOOST_PP_WHILE()
</UL>
<pre>
BOOST_PP_TUPLE_TO_LIST(2,(3,4))
</pre>
<h3>Uses</h3>
<ul>
<li>BOOST_PP_LIST_FOLD_RIGHT()</li>
</ul>
*/
#define BOOST_PP_LIST_TRANSFORM(F,P,L) BOOST_PP_LIST_TRANSFORM_D(0,F,P,L)