mirror of
https://github.com/boostorg/preprocessor.git
synced 2025-07-15 13:36:33 +02:00
Tweaking docs
[SVN r12604]
This commit is contained in:
@ -13,12 +13,7 @@
|
||||
* See http://www.boost.org for most recent version.
|
||||
*/
|
||||
|
||||
/** \file
|
||||
|
||||
<a href="../../../../boost/preprocessor/arithmetic.hpp">Click here to see the header.</a>
|
||||
|
||||
Includes all arithmetic headers.
|
||||
*/
|
||||
/** <P>Includes all arithmetic headers.</P> */
|
||||
|
||||
#include <boost/preprocessor/arithmetic/div.hpp>
|
||||
#include <boost/preprocessor/arithmetic/mod.hpp>
|
||||
|
@ -40,6 +40,6 @@
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/** Obsolete. Use BOOST_PP_ADD(). */
|
||||
/** <P>Obsolete. Use BOOST_PP_ADD().</P> */
|
||||
#define BOOST_PREPROCESSOR_ADD(X,Y) BOOST_PP_ADD(X,Y)
|
||||
#endif
|
||||
|
@ -38,6 +38,6 @@
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/** Obsolete. Use BOOST_PP_DIV(). */
|
||||
/** <P>Obsolete. Use BOOST_PP_DIV().</P> */
|
||||
#define BOOST_PREPROCESSOR_DIV(X,Y) BOOST_PP_DIV(X,Y)
|
||||
#endif
|
||||
|
@ -32,6 +32,6 @@
|
||||
#define BOOST_PP_MOD_F(D,P) (BOOST_PP_SUB_D(D,BOOST_PP_TUPLE2_ELEM0 P,BOOST_PP_TUPLE2_ELEM1 P),BOOST_PP_TUPLE2_ELEM1 P)
|
||||
#endif
|
||||
|
||||
/** Obsolete. Use BOOST_PP_MOD(). */
|
||||
/** <P>Obsolete. Use BOOST_PP_MOD().</P> */
|
||||
#define BOOST_PREPROCESSOR_MOD(X,Y) BOOST_PP_MOD(X,Y)
|
||||
#endif
|
||||
|
@ -37,6 +37,6 @@
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/** Obsolete. Use BOOST_PP_MUL(). */
|
||||
/** <P>Obsolete. Use BOOST_PP_MUL().</P> */
|
||||
#define BOOST_PREPROCESSOR_MUL(X,Y) BOOST_PP_MUL(X,Y)
|
||||
#endif
|
||||
|
@ -39,6 +39,6 @@
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/** Obsolete. Use BOOST_PP_SUB(X,Y). */
|
||||
/** <P>Obsolete. Use BOOST_PP_SUB(X,Y).</P> */
|
||||
#define BOOST_PREPROCESSOR_SUB(X,Y) BOOST_PP_SUB(X,Y)
|
||||
#endif
|
||||
|
@ -13,17 +13,12 @@
|
||||
* See http://www.boost.org for most recent version.
|
||||
*/
|
||||
|
||||
/** \file
|
||||
|
||||
<a href="../../../../boost/preprocessor/assert_msg.hpp">Click here to see the header.</a>
|
||||
*/
|
||||
|
||||
#include <boost/preprocessor/empty.hpp>
|
||||
#include <boost/preprocessor/if.hpp>
|
||||
|
||||
/** Expands to nothing if C != 0 and to MSG if C == 0. */
|
||||
/** <P>Expands to nothing if C != 0 and to MSG if C == 0.</P> */
|
||||
#define BOOST_PP_ASSERT_MSG(C,MSG) BOOST_PP_IF(C,BOOST_PP_EMPTY,MSG BOOST_PP_EMPTY)()
|
||||
|
||||
/** Obsolete. Use BOOST_PP_ASSERT_MSG(). */
|
||||
/** <P>Obsolete. Use BOOST_PP_ASSERT_MSG().</P> */
|
||||
#define BOOST_PREPROCESSOR_ASSERT_MSG(C,MSG) BOOST_PP_ASSERT_MSG(C,MSG)
|
||||
#endif
|
||||
|
@ -13,16 +13,11 @@
|
||||
* See http://www.boost.org for most recent version.
|
||||
*/
|
||||
|
||||
/** \file
|
||||
/** <P>Delays the catenation of X and Y.</P>
|
||||
|
||||
<a href="../../../../boost/preprocessor/cat.hpp">Click here to see the header.</a>
|
||||
*/
|
||||
<P>For example,</P>
|
||||
|
||||
/** Delays the catenation of X and Y.
|
||||
|
||||
For example,
|
||||
|
||||
<PRE>\verbatim
|
||||
<PRE>
|
||||
#define STATIC_ASSERT(EXPR)\
|
||||
enum\
|
||||
{ BOOST_PP_CAT(static_check_,__LINE__) = (EXPR) ? 1 : -1\
|
||||
@ -35,11 +30,11 @@ For example,
|
||||
// ...
|
||||
|
||||
STATIC_ASSERT(sizeof(int) <= sizeof(long));
|
||||
\endverbatim</PRE>
|
||||
</PRE>
|
||||
|
||||
expands to:
|
||||
<P>expands to:</P>
|
||||
|
||||
<PRE>\verbatim
|
||||
<PRE>
|
||||
enum
|
||||
{ static_check_152 = (sizeof(int) <= sizeof(long)) ? 1 : -1
|
||||
};
|
||||
@ -47,13 +42,13 @@ expands to:
|
||||
static_assert_152
|
||||
[ static_check_152
|
||||
];
|
||||
\endverbatim</PRE>
|
||||
</PRE>
|
||||
|
||||
Using BOOST_PP_CAT() above lets the PP expand the __LINE__. If the above code
|
||||
would use the ## operator directly then __LINE__ would not be expanded and
|
||||
the above would expand to:
|
||||
<P>Using BOOST_PP_CAT() above lets the PP expand the __LINE__. If the above
|
||||
code would use the ## operator directly then __LINE__ would not be expanded and
|
||||
the above would expand to:</P>
|
||||
|
||||
<PRE>\verbatim
|
||||
<PRE>
|
||||
enum
|
||||
{ static_check___LINE__ = (sizeof(int) <= sizeof(long)) ? 1 : -1
|
||||
};
|
||||
@ -61,7 +56,7 @@ the above would expand to:
|
||||
static_assert___LINE__
|
||||
[ static_check___LINE__
|
||||
];
|
||||
\endverbatim</PRE>
|
||||
</PRE>
|
||||
*/
|
||||
#define BOOST_PP_CAT(X,Y) BOOST_PP_CAT_DELAY(X,Y)
|
||||
|
||||
@ -70,6 +65,6 @@ the above would expand to:
|
||||
#define BOOST_PP_DO_CAT(X,Y) X##Y
|
||||
#endif
|
||||
|
||||
/** Obsolete. Use BOOST_PP_CAT(). */
|
||||
/** <P>Obsolete. Use BOOST_PP_CAT().</P> */
|
||||
#define BOOST_PREPROCESSOR_CAT(X,Y) BOOST_PP_CAT(X,Y)
|
||||
#endif
|
||||
|
@ -13,18 +13,15 @@
|
||||
* See http://www.boost.org for most recent version.
|
||||
*/
|
||||
|
||||
/** \file
|
||||
|
||||
<a href="../../../../boost/preprocessor/comma.hpp">Click here to see the header.</a>
|
||||
*/
|
||||
|
||||
/** Expands to a comma. Can be used with BOOST_PP_IF().
|
||||
/** <P>Expands to a comma. Can be used with BOOST_PP_IF().</P>
|
||||
|
||||
<H3>See</H3>
|
||||
- BOOST_PP_COMMA_IF()
|
||||
<UL>
|
||||
<LI>BOOST_PP_COMMA_IF()
|
||||
</UL>
|
||||
*/
|
||||
#define BOOST_PP_COMMA() ,
|
||||
|
||||
/** Obsolete. Use BOOST_PP_COMMA(). */
|
||||
/** <P>Obsolete. Use BOOST_PP_COMMA().</P> */
|
||||
#define BOOST_PREPROCESSOR_COMMA() ,
|
||||
#endif
|
||||
|
@ -13,18 +13,13 @@
|
||||
* See http://www.boost.org for most recent version.
|
||||
*/
|
||||
|
||||
/** \file
|
||||
|
||||
<a href="../../../../boost/preprocessor/comma_if.hpp">Click here to see the header.</a>
|
||||
*/
|
||||
|
||||
#include <boost/preprocessor/comma.hpp>
|
||||
#include <boost/preprocessor/empty.hpp>
|
||||
#include <boost/preprocessor/if.hpp>
|
||||
|
||||
/** Expands to a comma if C != 0 and nothing if C == 0. */
|
||||
/** <P>Expands to a comma if C != 0 and nothing if C == 0.</P> */
|
||||
#define BOOST_PP_COMMA_IF(C) BOOST_PP_IF(C,BOOST_PP_COMMA,BOOST_PP_EMPTY)()
|
||||
|
||||
/** Obsolete. Use BOOST_PP_COMMA_IF(). */
|
||||
/** <P>Obsolete. Use BOOST_PP_COMMA_IF().</P> */
|
||||
#define BOOST_PREPROCESSOR_COMMA_IF(C) BOOST_PP_COMMA_IF(C)
|
||||
#endif
|
||||
|
@ -13,12 +13,7 @@
|
||||
* See http://www.boost.org for most recent version.
|
||||
*/
|
||||
|
||||
/** \file
|
||||
|
||||
<a href="../../../../boost/preprocessor/comparison.hpp">Click here to see the header.</a>
|
||||
|
||||
Includes all comparison headers.
|
||||
*/
|
||||
/** <P>Includes all comparison headers.</P> */
|
||||
|
||||
#include <boost/preprocessor/comparison/equal.hpp>
|
||||
#include <boost/preprocessor/comparison/greater.hpp>
|
||||
|
@ -29,6 +29,6 @@
|
||||
#define BOOST_PP_EQUAL_D(D,X,Y) BOOST_PP_NOT(BOOST_PP_NOT_EQUAL_D(D,X,Y))
|
||||
#endif
|
||||
|
||||
/** Obsolete. Use BOOST_PP_EQUAL(). */
|
||||
/** <P>Obsolete. Use BOOST_PP_EQUAL().</P> */
|
||||
#define BOOST_PREPROCESSOR_EQUAL(X,Y) BOOST_PP_EQUAL(X,Y)
|
||||
#endif
|
||||
|
@ -28,6 +28,6 @@
|
||||
#define BOOST_PP_GREATER_D(D,X,Y) BOOST_PP_LESS_D(D,Y,X)
|
||||
#endif
|
||||
|
||||
/** Obsolete. Use BOOST_PP_GREATER(). */
|
||||
/** <P>Obsolete. Use BOOST_PP_GREATER().</P> */
|
||||
#define BOOST_PREPROCESSOR_GREATER(X,Y) BOOST_PP_GREATER(X,Y)
|
||||
#endif
|
||||
|
@ -28,6 +28,6 @@
|
||||
#define BOOST_PP_GREATER_EQUAL_D(D,X,Y) BOOST_PP_LESS_EQUAL_D(D,Y,X)
|
||||
#endif
|
||||
|
||||
/** Obsolete. Use BOOST_PP_GREATER_EQUAL(). */
|
||||
/** <P>Obsolete. Use BOOST_PP_GREATER_EQUAL().</P> */
|
||||
#define BOOST_PREPROCESSOR_GREATER_EQUAL(X,Y) BOOST_PP_GREATER_EQUAL(X,Y)
|
||||
#endif
|
||||
|
@ -30,6 +30,6 @@
|
||||
#define BOOST_PP_LESS_D(D,X,Y) BOOST_PP_AND(BOOST_PP_NOT_EQUAL_D(D,X,Y),BOOST_PP_LESS_EQUAL_D(D,X,Y))
|
||||
#endif
|
||||
|
||||
/** Obsolete. Use BOOST_PP_LESS(). */
|
||||
/** <P>Obsolete. Use BOOST_PP_LESS().</P> */
|
||||
#define BOOST_PREPROCESSOR_LESS(X,Y) BOOST_PP_LESS(X,Y)
|
||||
#endif
|
||||
|
@ -29,6 +29,6 @@
|
||||
#define BOOST_PP_LESS_EQUAL_D(D,X,Y) BOOST_PP_NOT(BOOST_PP_SUB_D(D,X,Y))
|
||||
#endif
|
||||
|
||||
/** Obsolete. Use BOOST_PP_LESS_EQUAL(). */
|
||||
/** <P>Obsolete. Use BOOST_PP_LESS_EQUAL().</P> */
|
||||
#define BOOST_PREPROCESSOR_LESS_EQUAL(X,Y) BOOST_PP_LESS_EQUAL(X,Y)
|
||||
#endif
|
||||
|
@ -30,6 +30,6 @@
|
||||
#define BOOST_PP_NOT_EQUAL_D(D,X,Y) BOOST_PP_BOOL(BOOST_PP_ADD_D(D,BOOST_PP_SUB_D(D,X,Y),BOOST_PP_SUB_D(D,Y,X)))
|
||||
#endif
|
||||
|
||||
/** Obsolete. Use BOOST_PP_NOT_EQUAL(). */
|
||||
/** <P>Obsolete. Use BOOST_PP_NOT_EQUAL().</P> */
|
||||
#define BOOST_PREPROCESSOR_NOT_EQUAL(X,Y) BOOST_PP_NOT_EQUAL(X,Y)
|
||||
#endif
|
||||
|
@ -13,19 +13,14 @@
|
||||
* See http://www.boost.org for most recent version.
|
||||
*/
|
||||
|
||||
/** \file
|
||||
/** <P>Decrements X expanding to a single token.</P>
|
||||
|
||||
<a href="../../../../boost/preprocessor/dec.hpp">Click here to see the header.</a>
|
||||
*/
|
||||
<P>For example, BOOST_PP_DEC(3) expands to 2 (a single token).</P>
|
||||
|
||||
/** Decrements X expanding to a single token.
|
||||
<P>BOOST_PP_DEC() uses saturation arithmetic. Decrementing 0 yeilds a 0.</P>
|
||||
|
||||
For example, BOOST_PP_DEC(3) expands to 2 (a single token).
|
||||
|
||||
BOOST_PP_DEC() uses saturation arithmetic. Decrementing 0 yeilds a 0.
|
||||
|
||||
Only decimal integer literals in the range [0,BOOST_PP_LIMIT_MAG] are
|
||||
supported.
|
||||
<P>Only decimal integer literals in the range [0,BOOST_PP_LIMIT_MAG] are
|
||||
supported.</P>
|
||||
*/
|
||||
#define BOOST_PP_DEC(X) BOOST_PP_DEC_DELAY(X)
|
||||
|
||||
@ -162,6 +157,6 @@ supported.
|
||||
#define BOOST_PP_DEC128 127
|
||||
#endif
|
||||
|
||||
/** Obsolete. Use BOOST_PP_DEC(). */
|
||||
/** <P>Obsolete. Use BOOST_PP_DEC().</P> */
|
||||
#define BOOST_PREPROCESSOR_DEC(X) BOOST_PP_DEC(X)
|
||||
#endif
|
||||
|
@ -13,41 +13,36 @@
|
||||
* See http://www.boost.org for most recent version.
|
||||
*/
|
||||
|
||||
/** \file
|
||||
/** <P>Expands to nothing. Used with BOOST_PP_IF() and as an unused parameter.</P>
|
||||
|
||||
<a href="../../../../boost/preprocessor/empty.hpp">Click here to see the header.</a>
|
||||
*/
|
||||
<P>Example usage as the implementation of BOOST_PP_COMMA_IF(C):</P>
|
||||
|
||||
/** Expands to nothing. Used with BOOST_PP_IF() and as an unused parameter.
|
||||
|
||||
Example usage as the implementation of BOOST_PP_COMMA_IF(C):
|
||||
|
||||
<PRE>\verbatim
|
||||
<PRE>
|
||||
#define BOOST_PP_COMMA_IF(C)\
|
||||
BOOST_PP_IF(C,BOOST_PP_COMMA,BOOST_PP_EMPTY)()
|
||||
\endverbatim</PRE>
|
||||
</PRE>
|
||||
|
||||
Example usage as an unused macro parameter:
|
||||
<P>Example usage as an unused macro parameter:</P>
|
||||
|
||||
<PRE>\verbatim
|
||||
<PRE>
|
||||
#define BOOST_PP_DEF(CV)\
|
||||
template<class base>\
|
||||
CV typename implement_subscript_using_begin_subscript<base>::value_type&\
|
||||
CV() typename implement_subscript_using_begin_subscript<base>::value_type&\
|
||||
implement_subscript_using_begin_subscript<base>::operator[]\
|
||||
( index_type\
|
||||
i\
|
||||
) CV \
|
||||
) CV()\
|
||||
{ return base::begin()[i];\
|
||||
}
|
||||
|
||||
BOOST_PP_DEF(BOOST_PP_EMPTY())
|
||||
BOOST_PP_DEF(const)
|
||||
BOOST_PP_DEF(BOOST_PP_EMPTY)
|
||||
BOOST_PP_DEF(const BOOST_PP_EMPTY)
|
||||
#undef BOOST_PP_DEF
|
||||
\endverbatim</PRE>
|
||||
</PRE>
|
||||
|
||||
The above expands to:
|
||||
<P>The above expands to:</P>
|
||||
|
||||
<PRE>\verbatim
|
||||
<PRE>
|
||||
template<class base>
|
||||
typename implement_subscript_using_begin_subscript<base>::value_type&
|
||||
implement_subscript_using_begin_subscript<base>::operator[]
|
||||
@ -65,13 +60,13 @@ The above expands to:
|
||||
) const
|
||||
{ return base::begin()[i];
|
||||
}
|
||||
\endverbatim</PRE>
|
||||
</PRE>
|
||||
|
||||
In case you wonder, the above code is part of a generalized layer for
|
||||
implementing the subscripting operators of a random access container.
|
||||
<P>In case you wonder, the above code is part of a generalized layer for
|
||||
implementing the subscripting operators of a random access container.</P>
|
||||
*/
|
||||
#define BOOST_PP_EMPTY()
|
||||
|
||||
/** Obsolete. Use BOOST_PP_EMPTY(). */
|
||||
/** <P>Obsolete. Use BOOST_PP_EMPTY().</P> */
|
||||
#define BOOST_PREPROCESSOR_EMPTY()
|
||||
#endif
|
||||
|
@ -13,25 +13,22 @@
|
||||
* See http://www.boost.org for most recent version.
|
||||
*/
|
||||
|
||||
/** \file
|
||||
|
||||
<a href="../../../../boost/preprocessor/enum.hpp">Click here to see the header.</a>
|
||||
*/
|
||||
|
||||
#include <boost/preprocessor/comma_if.hpp>
|
||||
#include <boost/preprocessor/repeat.hpp>
|
||||
#include <boost/preprocessor/tuple.hpp>
|
||||
|
||||
/** Generates a comma separated list.
|
||||
/** <P>Generates a comma separated list.</P>
|
||||
|
||||
In other words, expands to the sequence:
|
||||
<P>In other words, expands to the sequence:</P>
|
||||
|
||||
<PRE>\verbatim
|
||||
<PRE>
|
||||
F(0,P), F(1,P), ..., F(N-1,P)
|
||||
\endverbatim</PRE>
|
||||
</PRE>
|
||||
|
||||
<H3>Uses</H3>
|
||||
- BOOST_PP_REPEAT()
|
||||
<UL>
|
||||
<LI>BOOST_PP_REPEAT()
|
||||
</UL>
|
||||
*/
|
||||
#define BOOST_PP_ENUM(N,F,P) BOOST_PP_REPEAT(N,BOOST_PP_ENUM_F,(F,P))
|
||||
|
||||
|
@ -13,24 +13,21 @@
|
||||
* See http://www.boost.org for most recent version.
|
||||
*/
|
||||
|
||||
/** \file
|
||||
|
||||
<a href="../../../../boost/preprocessor/enum_params.hpp">Click here to see the header.</a>
|
||||
*/
|
||||
|
||||
#include <boost/preprocessor/cat.hpp>
|
||||
#include <boost/preprocessor/enum.hpp>
|
||||
|
||||
/** Generates a comma separated list of parameters.
|
||||
/** <P>Generates a comma separated list of parameters.</P>
|
||||
|
||||
In other words, expands to the sequence:
|
||||
<P>In other words, expands to the sequence:</P>
|
||||
|
||||
<PRE>\verbatim
|
||||
<PRE>
|
||||
P##0, P##1, ..., P##N-1
|
||||
\endverbatim</PRE>
|
||||
</PRE>
|
||||
|
||||
<H3>Uses</H3>
|
||||
- BOOST_PP_REPEAT()
|
||||
<UL>
|
||||
<LI>BOOST_PP_REPEAT()
|
||||
</UL>
|
||||
*/
|
||||
#define BOOST_PP_ENUM_PARAMS(N,P) BOOST_PP_ENUM(N,BOOST_PP_ENUM_PARAMS_F,P)
|
||||
|
||||
@ -38,6 +35,6 @@ In other words, expands to the sequence:
|
||||
#define BOOST_PP_ENUM_PARAMS_F(I,P) BOOST_PP_CAT(P,I)
|
||||
#endif
|
||||
|
||||
/** Obsolete. Use BOOST_PP_ENUM_PARAMS(). */
|
||||
/** <P>Obsolete. Use BOOST_PP_ENUM_PARAMS().</P> */
|
||||
#define BOOST_PREPROCESSOR_ENUM_PARAMS(N,P) BOOST_PP_ENUM_PARAMS(N,P)
|
||||
#endif
|
||||
|
@ -13,24 +13,21 @@
|
||||
* See http://www.boost.org for most recent version.
|
||||
*/
|
||||
|
||||
/** \file
|
||||
|
||||
<a href="../../../../boost/preprocessor/enum_params_with_a_default.hpp">Click here to see the header.</a>
|
||||
*/
|
||||
|
||||
#include <boost/preprocessor/cat.hpp>
|
||||
#include <boost/preprocessor/enum.hpp>
|
||||
|
||||
/** Generates a comma separated list of parameters with a default.
|
||||
/** <P>Generates a comma separated list of parameters with a default.</P>
|
||||
|
||||
In other words, expands to the sequence:
|
||||
<P>In other words, expands to the sequence:</P>
|
||||
|
||||
<PRE>\verbatim
|
||||
<PRE>
|
||||
P##0 = D, P##1 = D, ..., P##N-1 = D
|
||||
\endverbatim</PRE>
|
||||
</PRE>
|
||||
|
||||
<H3>Uses</H3>
|
||||
- BOOST_PP_REPEAT()
|
||||
<UL>
|
||||
<LI>BOOST_PP_REPEAT()
|
||||
</UL>
|
||||
*/
|
||||
#define BOOST_PP_ENUM_PARAMS_WITH_A_DEFAULT(N,P,D) BOOST_PP_ENUM(N,BOOST_PP_ENUM_PARAMS_WITH_A_DEFAULT_F,(P,D))
|
||||
|
||||
@ -42,6 +39,6 @@ In other words, expands to the sequence:
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/** Obsolete. Use BOOST_PP_ENUM_PARAMS_WITH_A_DEFAULT(). */
|
||||
/** <P>Obsolete. Use BOOST_PP_ENUM_PARAMS_WITH_A_DEFAULT().</P> */
|
||||
#define BOOST_PREPROCESSOR_ENUM_PARAMS_WITH_A_DEFAULT(N,P,D) BOOST_PP_ENUM_PARAMS_WITH_A_DEFAULT(N,P,D)
|
||||
#endif
|
||||
|
@ -13,24 +13,21 @@
|
||||
* See http://www.boost.org for most recent version.
|
||||
*/
|
||||
|
||||
/** \file
|
||||
|
||||
<a href="../../../../boost/preprocessor/enum_params_with_defaults.hpp">Click here to see the header.</a>
|
||||
*/
|
||||
|
||||
#include <boost/preprocessor/cat.hpp>
|
||||
#include <boost/preprocessor/enum.hpp>
|
||||
|
||||
/** Generates a comma separated list of parameters with defaults.
|
||||
/** <P>Generates a comma separated list of parameters with defaults.</P>
|
||||
|
||||
In other words, expands to the sequence:
|
||||
<P>In other words, expands to the sequence:</P>
|
||||
|
||||
<PRE>\verbatim
|
||||
<PRE>
|
||||
P##0 = D##0, P##1 = D##1, ..., P##N-1 = D##N-1
|
||||
\endverbatim</PRE>
|
||||
</PRE>
|
||||
|
||||
<H3>Uses</H3>
|
||||
- BOOST_PP_REPEAT()
|
||||
<UL>
|
||||
<LI>BOOST_PP_REPEAT()
|
||||
</UL>
|
||||
*/
|
||||
#define BOOST_PP_ENUM_PARAMS_WITH_DEFAULTS(N,P,D) BOOST_PP_ENUM(N,BOOST_PP_ENUM_PARAMS_WITH_DEFAULTS_F,(P,D))
|
||||
|
||||
@ -42,6 +39,6 @@ In other words, expands to the sequence:
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/** Obsolete. Use BOOST_PP_ENUM_PARAMS_WITH_DEFAULTS(). */
|
||||
/** <P>Obsolete. Use BOOST_PP_ENUM_PARAMS_WITH_DEFAULTS().</P> */
|
||||
#define BOOST_PREPROCESSOR_ENUM_PARAMS_WITH_DEFAULTS(N,P,D) BOOST_PP_ENUM_PARAMS_WITH_DEFAULTS(N,P,D)
|
||||
#endif
|
||||
|
@ -13,25 +13,22 @@
|
||||
* See http://www.boost.org for most recent version.
|
||||
*/
|
||||
|
||||
/** \file
|
||||
|
||||
<a href="../../../../boost/preprocessor/enum_shifted.hpp">Click here to see the header.</a>
|
||||
*/
|
||||
|
||||
#include <boost/preprocessor/enum.hpp>
|
||||
#include <boost/preprocessor/dec.hpp>
|
||||
#include <boost/preprocessor/inc.hpp>
|
||||
|
||||
/** Generates a comma separated shifted list.
|
||||
/** <P>Generates a comma separated shifted list.</P>
|
||||
|
||||
In other words, expands to the sequence:
|
||||
<P>In other words, expands to the sequence:</P>
|
||||
|
||||
<PRE>\verbatim
|
||||
<PRE>
|
||||
F(1,P), F(2,P), ..., F(N-1,P)
|
||||
\endverbatim</PRE>
|
||||
</PRE>
|
||||
|
||||
<H3>Uses</H3>
|
||||
- BOOST_PP_REPEAT()
|
||||
<UL>
|
||||
<LI>BOOST_PP_REPEAT()
|
||||
</UL>
|
||||
*/
|
||||
#define BOOST_PP_ENUM_SHIFTED(N,F,P) BOOST_PP_ENUM(BOOST_PP_DEC(N),BOOST_PP_ENUM_SHIFTED_F,(F,P))
|
||||
|
||||
|
@ -13,28 +13,27 @@
|
||||
* See http://www.boost.org for most recent version.
|
||||
*/
|
||||
|
||||
/** \file
|
||||
|
||||
<a href="../../../../boost/preprocessor/enum_shifted_params.hpp">Click here to see the header.</a>
|
||||
*/
|
||||
|
||||
#include <boost/preprocessor/cat.hpp>
|
||||
#include <boost/preprocessor/enum_shifted.hpp>
|
||||
|
||||
/** Generates a comma separated list of shifted actual parameters.
|
||||
/** <P>Generates a comma separated list of shifted actual parameters.</P>
|
||||
|
||||
In other words, expands to the sequence:
|
||||
<P>In other words, expands to the sequence:</P>
|
||||
|
||||
<PRE>\verbatim
|
||||
<PRE>
|
||||
P##1, P##2, ..., P##N-1
|
||||
\endverbatim</PRE>
|
||||
</PRE>
|
||||
|
||||
<H3>Uses</H3>
|
||||
- BOOST_PP_REPEAT()
|
||||
<UL>
|
||||
<LI>BOOST_PP_REPEAT()
|
||||
</UL>
|
||||
|
||||
<H3>Rationale</H3>
|
||||
- This macro facilitates a typical usage of the library. Shifted parameter
|
||||
<UL>
|
||||
<LI>This macro facilitates a typical usage of the library. Shifted parameter
|
||||
lists are common in template metaprograms.
|
||||
</UL>
|
||||
*/
|
||||
#define BOOST_PP_ENUM_SHIFTED_PARAMS(N,P) BOOST_PP_ENUM_SHIFTED(N,BOOST_PP_ENUM_SHIFTED_PARAMS_F,P)
|
||||
|
||||
@ -42,6 +41,6 @@ lists are common in template metaprograms.
|
||||
#define BOOST_PP_ENUM_SHIFTED_PARAMS_F(I,P) BOOST_PP_CAT(P,I)
|
||||
#endif
|
||||
|
||||
/** Obsolete. Use BOOST_PP_ENUM_SHIFTED_PARAMS(). */
|
||||
/** <P>Obsolete. Use BOOST_PP_ENUM_SHIFTED_PARAMS().</P> */
|
||||
#define BOOST_PREPROCESSOR_ENUM_SHIFTED_PARAMS(N,P) BOOST_PP_ENUM_SHIFTED_PARAMS(N,P)
|
||||
#endif
|
||||
|
@ -13,13 +13,8 @@
|
||||
* See http://www.boost.org for most recent version.
|
||||
*/
|
||||
|
||||
/** \file
|
||||
|
||||
<a href="../../../../boost/preprocessor/expand.hpp">Click here to see the header.</a>
|
||||
*/
|
||||
|
||||
#include <boost/preprocessor/identity.hpp>
|
||||
|
||||
/** Essentially macro expands the parameter X twice. */
|
||||
/** <P>Essentially macro expands the parameter X twice.</P> */
|
||||
#define BOOST_PP_EXPAND(X) X
|
||||
#endif
|
||||
|
@ -13,51 +13,48 @@
|
||||
* See http://www.boost.org for most recent version.
|
||||
*/
|
||||
|
||||
/** \file
|
||||
|
||||
<a href="../../../../boost/preprocessor/for.hpp">Click here to see the header.</a>
|
||||
*/
|
||||
|
||||
#include <boost/preprocessor/if.hpp>
|
||||
#include <boost/preprocessor/tuple/eat.hpp>
|
||||
|
||||
/** Repeats I(R,X) and iterates F(R,X) while C(R,X) is true.
|
||||
/** <P>Repeats I(R,X) and iterates F(R,X) while C(R,X) is true.</P>
|
||||
|
||||
In other words, expands to the sequence:
|
||||
<P>In other words, expands to the sequence:</P>
|
||||
|
||||
<PRE>\verbatim
|
||||
<PRE>
|
||||
I(R,X) I(R,F(R,X)) I(R,F(R,F(R,X))) ... I(R,F(R,F(...F(R,X)...)))
|
||||
\endverbatim</PRE>
|
||||
</PRE>
|
||||
|
||||
The length of the sequence is determined by C(R,X).
|
||||
<P>The length of the sequence is determined by C(R,X).</P>
|
||||
|
||||
<H3>Legend</H3>
|
||||
|
||||
- <B>X</B> is the current state of iteration. The state is usually a tuple.
|
||||
- <B>C</B> is the condition for iteration. It must expand to a decimal integer
|
||||
literal.
|
||||
- <B>F</B> is the iterated macro. Note that if the state is a tuple, then
|
||||
<UL>
|
||||
<LI><B>X</B> is the current state of iteration. The state is usually a tuple.
|
||||
<LI><B>C</B> is the condition for iteration. It must expand to a decimal
|
||||
integer literal.
|
||||
<LI><B>F</B> is the iterated macro. Note that if the state is a tuple, then
|
||||
F(R,X) usually expands to a tuple of the same number of elements.
|
||||
- <B>I</B> is the state instantiation macro.
|
||||
- <B>R</B> is the recursion depth and should only be used as a parameter to
|
||||
other macros using BOOST_PP_FOR() or for invoking BOOST_PP_FOR##R() directly.
|
||||
For each macro using BOOST_PP_FOR(), there is a version of the macro,
|
||||
distinguished by the R suffix, that accepts an additional recursion depth as
|
||||
the first parameter. This technique is necessary to avoid recursively
|
||||
expanding the same macro again, which is not permitted by the C++ preprocessor.
|
||||
<LI><B>I</B> is the state instantiation macro.
|
||||
<LI><B>R</B> is the recursion depth and should only be used as a parameter to
|
||||
other macros using BOOST_PP_FOR() or for invoking BOOST_PP_FOR##R()
|
||||
directly. For each macro using BOOST_PP_FOR(), there is a version of the
|
||||
macro, distinguished by the R suffix, that accepts an additional
|
||||
recursion depth as the first parameter. This technique is necessary to
|
||||
avoid recursively expanding the same macro again, which is not permitted
|
||||
by the C++ preprocessor.
|
||||
</UL>
|
||||
|
||||
<H3>BOOST_PP_REPEAT() vs BOOST_PP_FOR()</H3>
|
||||
|
||||
BOOST_PP_FOR() is a generalization of BOOST_PP_REPEAT(). This means that
|
||||
<P>BOOST_PP_FOR() is a generalization of BOOST_PP_REPEAT(). This means that
|
||||
BOOST_PP_REPEAT() can be implemented using BOOST_PP_FOR(). Unfortunately,
|
||||
BOOST_PP_FOR() is slower than BOOST_PP_REPEAT(). In addition,
|
||||
BOOST_PP_REPEAT() was introduced earlier, is generally easier to use, and is
|
||||
still quite useful on its own.
|
||||
still quite useful on its own.</P>
|
||||
|
||||
<H3>2D and 3D repetition</H3>
|
||||
|
||||
BOOST_PP_FOR() can be used for multidimensional repetition simply by invoking
|
||||
BOOST_PP_FOR##R() directly.
|
||||
<P>BOOST_PP_FOR() can be used for multidimensional repetition simply by
|
||||
invoking BOOST_PP_FOR##R() directly.</P>
|
||||
*/
|
||||
#define BOOST_PP_FOR(X,C,F,I) BOOST_PP_FOR0(X,C,F,I)
|
||||
|
||||
|
@ -13,34 +13,30 @@
|
||||
* See http://www.boost.org for most recent version.
|
||||
*/
|
||||
|
||||
/** \file
|
||||
|
||||
<a href="../../../../boost/preprocessor/identity.hpp">Click here to see the header.</a>
|
||||
*/
|
||||
|
||||
#include <boost/preprocessor/empty.hpp>
|
||||
|
||||
/** Expands to X once invoked.
|
||||
/** <P>Expands to X once invoked.</P>
|
||||
|
||||
Designed to be used with BOOST_PP_IF(), when one of the clauses need to be invoked.
|
||||
<P>Designed to be used with BOOST_PP_IF(), when one of the clauses need to be
|
||||
invoked.</P>
|
||||
|
||||
For example,
|
||||
<P>For example,</P>
|
||||
|
||||
<PRE>\verbatim
|
||||
BOOST_PP_IDENTITY(X)()
|
||||
// ^^ NOTE!
|
||||
\endverbatim</PRE>
|
||||
<PRE>
|
||||
BOOST_PP_IDENTITY(X)<B>()</B>
|
||||
</PRE>
|
||||
|
||||
expands to:
|
||||
<P>expands to:</P>
|
||||
|
||||
<PRE>\verbatim
|
||||
<PRE>
|
||||
X
|
||||
\endverbatim</PRE>
|
||||
</PRE>
|
||||
|
||||
NOTE: If BOOST_PP_IDENTITY() is not invoked, the expansion will not be usable.
|
||||
<P>NOTE: If BOOST_PP_IDENTITY() is not invoked, the expansion will not be
|
||||
usable.</P>
|
||||
*/
|
||||
#define BOOST_PP_IDENTITY(X) X BOOST_PP_EMPTY
|
||||
|
||||
/** Obsolete. Use BOOST_PP_IDENTITY(). */
|
||||
/** <P>Obsolete. Use BOOST_PP_IDENTITY().</P> */
|
||||
#define BOOST_PREPROCESSOR_IDENTITY(X) BOOST_PP_IDENTITY(X)
|
||||
#endif
|
||||
|
@ -13,17 +13,13 @@
|
||||
* See http://www.boost.org for most recent version.
|
||||
*/
|
||||
|
||||
/** \file
|
||||
|
||||
<a href="../../../../boost/preprocessor/if.hpp">Click here to see the header.</a>
|
||||
*/
|
||||
|
||||
#include <boost/preprocessor/logical/bool.hpp>
|
||||
#include <boost/preprocessor/tuple/elem.hpp>
|
||||
|
||||
/** Expands to T if C != 0 and E if C == 0.
|
||||
BOOST_PP_IF() enables convenient generation of lists using
|
||||
BOOST_PP_REPEAT().
|
||||
/** <P>Expands to T if C != 0 and E if C == 0.</P>
|
||||
|
||||
<P>BOOST_PP_IF() enables convenient generation of lists using
|
||||
BOOST_PP_REPEAT().</P>
|
||||
*/
|
||||
#define BOOST_PP_IF(C,T,E) BOOST_PP_IF_BOOL(BOOST_PP_BOOL(C))(E,T)
|
||||
|
||||
@ -32,6 +28,6 @@ BOOST_PP_REPEAT().
|
||||
#define BOOST_PP_IF_BOOL_DELAY(C) BOOST_PP_TUPLE2_ELEM##C
|
||||
#endif
|
||||
|
||||
/** Obsolete. Use BOOST_PP_IF(). */
|
||||
/** <P>Obsolete. Use BOOST_PP_IF().</P> */
|
||||
#define BOOST_PREPROCESSOR_IF(C,T,E) BOOST_PP_IF(C,T,E)
|
||||
#endif
|
||||
|
@ -13,20 +13,15 @@
|
||||
* See http://www.boost.org for most recent version.
|
||||
*/
|
||||
|
||||
/** \file
|
||||
/** <P>Increments X expanding to a single token.</P>
|
||||
|
||||
<a href="../../../../boost/preprocessor/inc.hpp">Click here to see the header.</a>
|
||||
*/
|
||||
<P>For example, BOOST_PP_INC(3) expands to 4 (a single token).</P>
|
||||
|
||||
/** Increments X expanding to a single token.
|
||||
<P>BOOST_PP_INC() uses saturation arithmetic. Incrementing a
|
||||
BOOST_PP_LIMIT_MAG yields a BOOST_PP_LIMIT_MAG.</P>
|
||||
|
||||
For example, BOOST_PP_INC(3) expands to 4 (a single token).
|
||||
|
||||
BOOST_PP_INC() uses saturation arithmetic. Incrementing a
|
||||
BOOST_PP_LIMIT_MAG yields a BOOST_PP_LIMIT_MAG.
|
||||
|
||||
Only decimal integer literals in the range [0,BOOST_PP_LIMIT_MAG] are
|
||||
supported.
|
||||
<P>Only decimal integer literals in the range [0,BOOST_PP_LIMIT_MAG] are
|
||||
supported.</P>
|
||||
*/
|
||||
#define BOOST_PP_INC(X) BOOST_PP_INC_DELAY(X)
|
||||
|
||||
@ -163,6 +158,6 @@ supported.
|
||||
#define BOOST_PP_INC128 128
|
||||
#endif
|
||||
|
||||
/** Obsolete. Use BOOST_PP_INC(). */
|
||||
/** <P>Obsolete. Use BOOST_PP_INC().</P> */
|
||||
#define BOOST_PREPROCESSOR_INC(X) BOOST_PP_INC(X)
|
||||
#endif
|
||||
|
@ -13,41 +13,40 @@
|
||||
* See http://www.boost.org for most recent version.
|
||||
*/
|
||||
|
||||
/** \file
|
||||
/** <P>Expands to the number of dimensions of repeat supported by the
|
||||
library.</P>
|
||||
|
||||
<a href="../../../../boost/preprocessor/limits.hpp">Click here to see the header.</a>
|
||||
*/
|
||||
|
||||
/** Expands to the number of dimensions of repeat supported by the library.
|
||||
|
||||
The repeat macros are named BOOST_PP_REPEAT(), BOOST_PP_REPEAT_2ND(),
|
||||
BOOST_PP_REPEAT_3RD(), ...
|
||||
<P>The repeat macros are named BOOST_PP_REPEAT(), BOOST_PP_REPEAT_2ND(),
|
||||
BOOST_PP_REPEAT_3RD(), ...</P>
|
||||
*/
|
||||
#define BOOST_PP_LIMIT_DIM 3
|
||||
|
||||
/** Expands to the maximum straight numeric literal supported by the library.
|
||||
/** <P>Expands to the maximum straight numeric literal supported by the
|
||||
library.</P>
|
||||
|
||||
This is also the limit of the repetition primitives (BOOST_PP_ENUM family and
|
||||
BOOST_PP_REPEAT family).
|
||||
<P>This is also the limit of the repetition primitives (BOOST_PP_ENUM family
|
||||
and BOOST_PP_REPEAT family).</P>
|
||||
|
||||
NOTES:
|
||||
- Only decimal integer literals in the range [0,BOOST_PP_LIMIT_MAG]
|
||||
<P>NOTES:</P>
|
||||
<UL>
|
||||
<LI>Only decimal integer literals in the range [0,BOOST_PP_LIMIT_MAG]
|
||||
are supported.
|
||||
- All arithmetic operations (ADD,SUB,MUL,DIV) use saturation arithmetic.
|
||||
- The maximum repetition count supported by the library may not be reached
|
||||
<LI>All arithmetic operations (ADD,SUB,MUL,DIV) use saturation arithmetic.
|
||||
<LI>The maximum repetition count supported by the library may not be reached
|
||||
due to compiler limitations.
|
||||
</UL>
|
||||
*/
|
||||
#define BOOST_PP_LIMIT_MAG 128
|
||||
|
||||
/** Expands to the maximum tuple length supported by the library. */
|
||||
/** <P>Expands to the maximum tuple length supported by the library.</P> */
|
||||
#define BOOST_PP_LIMIT_TUPLE 16
|
||||
|
||||
/** Obsolete. Use BOOST_PP_LIMIT_DIM. */
|
||||
/** <P>Obsolete. Use BOOST_PP_LIMIT_DIM.</P> */
|
||||
#define BOOST_PREPROCESSOR_LIMIT_DIM BOOST_PP_LIMIT_DIM
|
||||
|
||||
/** Obsolete. Use BOOST_PP_LIMIT_MAG. */
|
||||
/** <P>Obsolete. Use BOOST_PP_LIMIT_MAG.</P> */
|
||||
#define BOOST_PREPROCESSOR_LIMIT_MAG BOOST_PP_LIMIT_MAG
|
||||
|
||||
/** Obsolete. Use BOOST_PP_LIMIT_TUPLE. */
|
||||
/** <P>Obsolete. Use BOOST_PP_LIMIT_TUPLE.</P> */
|
||||
#define BOOST_PREPROCESSOR_LIMIT_TUPLE BOOST_PP_LIMIT_TUPLE
|
||||
#endif
|
||||
|
@ -13,12 +13,7 @@
|
||||
* See http://www.boost.org for most recent version.
|
||||
*/
|
||||
|
||||
/** \file
|
||||
|
||||
<a href="../../../../boost/preprocessor/list.hpp">Click here to see the header.</a>
|
||||
|
||||
Includes all list headers.
|
||||
*/
|
||||
/** <P>Includes all list headers.</P> */
|
||||
|
||||
#include <boost/preprocessor/list/append.hpp>
|
||||
#include <boost/preprocessor/list/at.hpp>
|
||||
|
@ -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)
|
||||
|
||||
|
@ -13,12 +13,7 @@
|
||||
* See http://www.boost.org for most recent version.
|
||||
*/
|
||||
|
||||
/** \file
|
||||
|
||||
<a href="../../../../boost/preprocessor/logical.hpp">Click here to see the header.</a>
|
||||
|
||||
Includes all logical headers.
|
||||
*/
|
||||
/** <P>Includes all logical headers.</P> */
|
||||
|
||||
#include <boost/preprocessor/logical/or.hpp>
|
||||
#include <boost/preprocessor/logical/xor.hpp>
|
||||
|
@ -13,19 +13,14 @@
|
||||
* See http://www.boost.org for most recent version.
|
||||
*/
|
||||
|
||||
/** \file
|
||||
|
||||
<a href="../../../../boost/preprocessor/logical/and.hpp">Click here to see the header.</a>
|
||||
*/
|
||||
|
||||
#include <boost/preprocessor/logical/not.hpp>
|
||||
|
||||
/** Expands to the logical AND of the operands.
|
||||
/** <P>Expands to the logical AND of the operands.</P>
|
||||
|
||||
For example, BOOST_PP_AND(0,5) expands to 0 (a single token).
|
||||
<P>For example, BOOST_PP_AND(0,5) expands to 0 (a single token).</P>
|
||||
*/
|
||||
#define BOOST_PP_AND(X,Y) BOOST_PP_NOR(BOOST_PP_NOT(X),BOOST_PP_NOT(Y))
|
||||
|
||||
/** Obsolete. Use BOOST_PP_AND(). */
|
||||
/** <P>Obsolete. Use BOOST_PP_AND().</P> */
|
||||
#define BOOST_PREPROCESSOR_AND(X,Y) BOOST_PP_AND(X,Y)
|
||||
#endif
|
||||
|
@ -13,12 +13,7 @@
|
||||
* See http://www.boost.org for most recent version.
|
||||
*/
|
||||
|
||||
/** \file
|
||||
|
||||
<a href="../../../../boost/preprocessor/logical/bool.hpp">Click here to see the header.</a>
|
||||
*/
|
||||
|
||||
/** Expands to 0 if X == 0 and 1 if X != 0. */
|
||||
/** <P>Expands to 0 if X == 0 and 1 if X != 0.</P> */
|
||||
#define BOOST_PP_BOOL(X) BOOST_PP_BOOL_DELAY(X)
|
||||
|
||||
#ifndef DOXYGEN_SHOULD_SKIP_THIS
|
||||
@ -157,6 +152,6 @@
|
||||
#define BOOST_PP_BOOL128 1
|
||||
#endif
|
||||
|
||||
/** Obsolete. Use BOOST_PP_BOOL(). */
|
||||
/** <P>Obsolete. Use BOOST_PP_BOOL().</P> */
|
||||
#define BOOST_PREPROCESSOR_BOOL(X) BOOST_PP_BOOL(X)
|
||||
#endif
|
||||
|
@ -13,16 +13,11 @@
|
||||
* See http://www.boost.org for most recent version.
|
||||
*/
|
||||
|
||||
/** \file
|
||||
|
||||
<a href="../../../../boost/preprocessor/logical/nor.hpp">Click here to see the header.</a>
|
||||
*/
|
||||
|
||||
#include <boost/preprocessor/logical/bool.hpp>
|
||||
|
||||
/** Expands to the logical NEITHER OR of the operands.
|
||||
/** <P>Expands to the logical NEITHER OR of the operands.</P>
|
||||
|
||||
For example, BOOST_PP_NOR(0,5) expands to 0 (a single token).
|
||||
<P>For example, BOOST_PP_NOR(0,5) expands to 0 (a single token).</P>
|
||||
*/
|
||||
#define BOOST_PP_NOR(X,Y) BOOST_PP_NOR_BOOL(BOOST_PP_BOOL(X),BOOST_PP_BOOL(Y))
|
||||
|
||||
@ -35,6 +30,6 @@ For example, BOOST_PP_NOR(0,5) expands to 0 (a single token).
|
||||
#define BOOST_PP_NOR_BOOL11 0
|
||||
#endif
|
||||
|
||||
/** Obsolete. Use BOOST_PP_NOR(). */
|
||||
/** <P>Obsolete. Use BOOST_PP_NOR().</P> */
|
||||
#define BOOST_PREPROCESSOR_NOR(X,Y) BOOST_PP_NOR(X,Y)
|
||||
#endif
|
||||
|
@ -13,19 +13,14 @@
|
||||
* See http://www.boost.org for most recent version.
|
||||
*/
|
||||
|
||||
/** \file
|
||||
|
||||
<a href="../../../../boost/preprocessor/logical/not.hpp">Click here to see the header.</a>
|
||||
*/
|
||||
|
||||
#include <boost/preprocessor/logical/nor.hpp>
|
||||
|
||||
/** Expands to the logical NOT of the operand.
|
||||
/** <P>Expands to the logical NOT of the operand.</P>
|
||||
|
||||
For example, BOOST_PP_NOT(0) expands to 1 (a single token).
|
||||
<P>For example, BOOST_PP_NOT(0) expands to 1 (a single token).</P>
|
||||
*/
|
||||
#define BOOST_PP_NOT(X) BOOST_PP_NOR(X,X)
|
||||
|
||||
/** Obsolete. Use BOOST_PP_NOT(). */
|
||||
/** <P>Obsolete. Use BOOST_PP_NOT().</P> */
|
||||
#define BOOST_PREPROCESSOR_NOT(X) BOOST_PP_NOT(X)
|
||||
#endif
|
||||
|
@ -13,19 +13,14 @@
|
||||
* See http://www.boost.org for most recent version.
|
||||
*/
|
||||
|
||||
/** \file
|
||||
|
||||
<a href="../../../../boost/preprocessor/logical/or.hpp">Click here to see the header.</a>
|
||||
*/
|
||||
|
||||
#include <boost/preprocessor/logical/not.hpp>
|
||||
|
||||
/** Expands to the logical OR of the operands.
|
||||
/** <P>Expands to the logical OR of the operands.</P>
|
||||
|
||||
For example, BOOST_PP_OR(0,2) expands to 1 (a single token).
|
||||
<P>For example, BOOST_PP_OR(0,2) expands to 1 (a single token).</P>
|
||||
*/
|
||||
#define BOOST_PP_OR(X,Y) BOOST_PP_NOT(BOOST_PP_NOR(X,Y))
|
||||
|
||||
/** Obsolete. Use BOOST_PP_OR(). */
|
||||
/** <P>Obsolete. Use BOOST_PP_OR().</P> */
|
||||
#define BOOST_PREPROCESSOR_OR(X,Y) BOOST_PP_OR(X,Y)
|
||||
#endif
|
||||
|
@ -13,19 +13,14 @@
|
||||
* See http://www.boost.org for most recent version.
|
||||
*/
|
||||
|
||||
/** \file
|
||||
|
||||
<a href="../../../../boost/preprocessor/logical/xor.hpp">Click here to see the header.</a>
|
||||
*/
|
||||
|
||||
#include <boost/preprocessor/logical/and.hpp>
|
||||
|
||||
/** Expands to the logical EXCLUSIVE OR of the operands.
|
||||
/** <P>Expands to the logical EXCLUSIVE OR of the operands.</P>
|
||||
|
||||
For example, BOOST_PP_XOR(1,2) expands to 0 (a single token).
|
||||
<P>For example, BOOST_PP_XOR(1,2) expands to 0 (a single token).</P>
|
||||
*/
|
||||
#define BOOST_PP_XOR(X,Y) BOOST_PP_NOR(BOOST_PP_NOR(X,Y),BOOST_PP_AND(X,Y))
|
||||
|
||||
/** Obsolete. Use BOOST_PP_XOR(). */
|
||||
/** <P>Obsolete. Use BOOST_PP_XOR().</P> */
|
||||
#define BOOST_PREPROCESSOR_XOR(X,Y) BOOST_PP_XOR(X,Y)
|
||||
#endif
|
||||
|
@ -13,20 +13,17 @@
|
||||
* See http://www.boost.org for most recent version.
|
||||
*/
|
||||
|
||||
/** \file
|
||||
|
||||
<a href="../../../../boost/preprocessor/max.hpp">Click here to see the header.</a>
|
||||
*/
|
||||
|
||||
#include <boost/preprocessor/comparison/less_equal.hpp>
|
||||
#include <boost/preprocessor/if.hpp>
|
||||
|
||||
/** Expands to the maximum of X and Y.
|
||||
/** <P>Expands to the maximum of X and Y.</P>
|
||||
|
||||
For example, BOOST_PP_MAX(5,7) expands to 7 (a single token).
|
||||
<P>For example, BOOST_PP_MAX(5,7) expands to 7 (a single token).</P>
|
||||
|
||||
<H3>Uses</H3>
|
||||
- BOOST_PP_WHILE()
|
||||
<UL>
|
||||
<LI>BOOST_PP_WHILE()
|
||||
</UL>
|
||||
*/
|
||||
#define BOOST_PP_MAX(X,Y) BOOST_PP_MAX_D(0,X,Y)
|
||||
|
||||
@ -34,6 +31,6 @@ For example, BOOST_PP_MAX(5,7) expands to 7 (a single token).
|
||||
#define BOOST_PP_MAX_D(D,X,Y) BOOST_PP_IF(BOOST_PP_LESS_EQUAL_D(D,X,Y),Y,X)
|
||||
#endif
|
||||
|
||||
/** Obsolete. Use BOOST_PP_MAX(). */
|
||||
/** <P>Obsolete. Use BOOST_PP_MAX().</P> */
|
||||
#define BOOST_PREPROCESSOR_MAX(X,Y) BOOST_PP_MAX(X,Y)
|
||||
#endif
|
||||
|
@ -13,20 +13,17 @@
|
||||
* See http://www.boost.org for most recent version.
|
||||
*/
|
||||
|
||||
/** \file
|
||||
|
||||
<a href="../../../../boost/preprocessor/min.hpp">Click here to see the header.</a>
|
||||
*/
|
||||
|
||||
#include <boost/preprocessor/comparison/less_equal.hpp>
|
||||
#include <boost/preprocessor/if.hpp>
|
||||
|
||||
/** Expands to the minimum of X and Y.
|
||||
/** <P>Expands to the minimum of X and Y.</P>
|
||||
|
||||
For example, BOOST_PP_MIN(5,7) expands to 5 (a single token).
|
||||
<P>For example, BOOST_PP_MIN(5,7) expands to 5 (a single token).</P>
|
||||
|
||||
<H3>Uses</H3>
|
||||
- BOOST_PP_WHILE()
|
||||
<UL>
|
||||
<LI>BOOST_PP_WHILE()
|
||||
</UL>
|
||||
*/
|
||||
#define BOOST_PP_MIN(X,Y) BOOST_PP_MIN_D(0,X,Y)
|
||||
|
||||
@ -34,6 +31,6 @@ For example, BOOST_PP_MIN(5,7) expands to 5 (a single token).
|
||||
#define BOOST_PP_MIN_D(D,X,Y) BOOST_PP_IF(BOOST_PP_LESS_EQUAL_D(D,Y,X),Y,X)
|
||||
#endif
|
||||
|
||||
/** Obsolete. Use BOOST_PP_MIN(). */
|
||||
/** <P>Obsolete. Use BOOST_PP_MIN().</P> */
|
||||
#define BOOST_PREPROCESSOR_MIN(X,Y) BOOST_PP_MIN(X,Y)
|
||||
#endif
|
||||
|
@ -13,30 +13,29 @@
|
||||
* See http://www.boost.org for most recent version.
|
||||
*/
|
||||
|
||||
/** \file
|
||||
/** <P>Repeats the macro M(I,P) for I = [0,N-1[.</P>
|
||||
|
||||
<a href="../../../../boost/preprocessor/repeat.hpp">Click here to see the header.</a>
|
||||
*/
|
||||
<P>In other words, expands to the sequence:</P>
|
||||
|
||||
/** Repeats the macro M(I,P) for I = [0,N-1[.
|
||||
|
||||
In other words, expands to the sequence:
|
||||
|
||||
<PRE>\verbatim
|
||||
<PRE>
|
||||
M(0,P) M(1,P) ... M(N-1,P)
|
||||
\endverbatim</PRE>
|
||||
</PRE>
|
||||
|
||||
<H3>2D and 3D repetition</H3>
|
||||
|
||||
2D and 3D repetition are supported with the BOOST_PP_REPEAT_2ND() and
|
||||
BOOST_PP_REPEAT_3RD() macros.
|
||||
<P>2D and 3D repetition are supported with the BOOST_PP_REPEAT_2ND() and
|
||||
BOOST_PP_REPEAT_3RD() macros.</P>
|
||||
|
||||
<H3>Example</H3>
|
||||
- <a href="../../example/repeat_2d.c">repeat_2d.c</a>
|
||||
<UL>
|
||||
<LI><a href="../../example/repeat_2d.c">repeat_2d.c</a>
|
||||
</UL>
|
||||
|
||||
<H3>See</H3>
|
||||
- BOOST_PP_FOR()
|
||||
- BOOST_PP_LIMIT_MAG
|
||||
<UL>
|
||||
<LI>BOOST_PP_FOR()
|
||||
<LI>BOOST_PP_LIMIT_MAG
|
||||
</UL>
|
||||
*/
|
||||
#define BOOST_PP_REPEAT(N,M,P) BOOST_PP_REPEAT_DELAY(N,M,P)
|
||||
|
||||
@ -173,6 +172,6 @@ BOOST_PP_REPEAT_3RD() macros.
|
||||
#define BOOST_PP_REPEAT128(M,P) BOOST_PP_REPEAT127(M,P) M(127,P)
|
||||
#endif
|
||||
|
||||
/** Obsolete. Use BOOST_PP_REPEAT(). */
|
||||
/** <P>Obsolete. Use BOOST_PP_REPEAT().</P> */
|
||||
#define BOOST_PREPROCESSOR_REPEAT(N,M,P) BOOST_PP_REPEAT(N,M,P)
|
||||
#endif
|
||||
|
@ -13,12 +13,7 @@
|
||||
* See http://www.boost.org for most recent version.
|
||||
*/
|
||||
|
||||
/** \file
|
||||
|
||||
<a href="../../../../boost/preprocessor/repeat_2nd.hpp">Click here to see the header.</a>
|
||||
*/
|
||||
|
||||
/** Same as BOOST_PP_REPEAT(), but implemented independently. */
|
||||
/** <P>Same as BOOST_PP_REPEAT(), but implemented independently.</P> */
|
||||
#define BOOST_PP_REPEAT_2ND(N,M,P) BOOST_PP_REPEAT_2ND_DELAY(N,M,P)
|
||||
|
||||
#ifndef DOXYGEN_SHOULD_SKIP_THIS
|
||||
@ -154,6 +149,6 @@
|
||||
#define BOOST_PP_REPEAT_2ND128(M,P) BOOST_PP_REPEAT_2ND127(M,P) M(127,P)
|
||||
#endif
|
||||
|
||||
/** Obsolete. Use BOOST_PP_REPEAT_2ND(). */
|
||||
/** <P>Obsolete. Use BOOST_PP_REPEAT_2ND().</P> */
|
||||
#define BOOST_PREPROCESSOR_REPEAT_2ND(N,M,P) BOOST_PP_REPEAT_2ND(N,M,P)
|
||||
#endif
|
||||
|
@ -13,12 +13,7 @@
|
||||
* See http://www.boost.org for most recent version.
|
||||
*/
|
||||
|
||||
/** \file
|
||||
|
||||
<a href="../../../../boost/preprocessor/repeat_3rd.hpp">Click here to see the header.</a>
|
||||
*/
|
||||
|
||||
/** Same as BOOST_PP_REPEAT(), but implemented independently. */
|
||||
/** <P>Same as BOOST_PP_REPEAT(), but implemented independently.</P> */
|
||||
#define BOOST_PP_REPEAT_3RD(N,M,P) BOOST_PP_REPEAT_3RD_DELAY(N,M,P)
|
||||
|
||||
#ifndef DOXYGEN_SHOULD_SKIP_THIS
|
||||
@ -154,6 +149,6 @@
|
||||
#define BOOST_PP_REPEAT_3RD128(M,P) BOOST_PP_REPEAT_3RD127(M,P) M(127,P)
|
||||
#endif
|
||||
|
||||
/** Obsolete. Use BOOST_PP_REPEAT_3RD(). */
|
||||
/** <P>Obsolete. Use BOOST_PP_REPEAT_3RD().</P> */
|
||||
#define BOOST_PREPROCESSOR_REPEAT_3RD(N,M,P) BOOST_PP_REPEAT_3RD(N,M,P)
|
||||
#endif
|
||||
|
@ -13,37 +13,32 @@
|
||||
* See http://www.boost.org for most recent version.
|
||||
*/
|
||||
|
||||
/** \file
|
||||
/** <P>Delays the stringization of X.</P>
|
||||
|
||||
<a href="../../../../boost/preprocessor/stringize.hpp">Click here to see the header.</a>
|
||||
*/
|
||||
<P>For example,</P>
|
||||
|
||||
/** Delays the stringization of X.
|
||||
|
||||
For example,
|
||||
|
||||
<PRE>\verbatim
|
||||
<PRE>
|
||||
#define NOTE(STR)\
|
||||
message(__FILE__ "(" BOOST_PP_STRINGIZE(__LINE__) ") : " STR)
|
||||
|
||||
// ...
|
||||
|
||||
#pragma NOTE("TBD!")
|
||||
\endverbatim</PRE>
|
||||
</PRE>
|
||||
|
||||
expands to:
|
||||
<P>expands to:</P>
|
||||
|
||||
<PRE>\verbatim
|
||||
<PRE>
|
||||
#pragma message("examples.cpp" "(" "20" ") : " "TBD!")
|
||||
\endverbatim</PRE>
|
||||
</PRE>
|
||||
|
||||
The use of BOOST_PP_STRINGIZE() above lets the PP expand the __LINE__
|
||||
<P>The use of BOOST_PP_STRINGIZE() above lets the PP expand the __LINE__
|
||||
before stringizing it. If # would be used directly, the code would
|
||||
expand to:
|
||||
expand to:</P>
|
||||
|
||||
<PRE>\verbatim
|
||||
<PRE>
|
||||
#pragma message("examples.cpp" "(" "__LINE__" ") : " "TBD!")
|
||||
\endverbatim</PRE>
|
||||
</PRE>
|
||||
*/
|
||||
#define BOOST_PP_STRINGIZE(X) BOOST_PP_STRINGIZE_DELAY(X)
|
||||
|
||||
@ -52,6 +47,6 @@ expand to:
|
||||
#define BOOST_PP_DO_STRINGIZE(X) #X
|
||||
#endif
|
||||
|
||||
/** Obsolete. Use BOOST_PP_STRINGIZE(). */
|
||||
/** <P>Obsolete. Use BOOST_PP_STRINGIZE().</P> */
|
||||
#define BOOST_PREPROCESSOR_STRINGIZE(E) BOOST_PP_STRINGIZE(E)
|
||||
#endif
|
||||
|
@ -13,12 +13,7 @@
|
||||
* See http://www.boost.org for most recent version.
|
||||
*/
|
||||
|
||||
/** \file
|
||||
|
||||
<a href="../../../../boost/preprocessor/tuple.hpp">Click here to see the header.</a>
|
||||
|
||||
Includes all tuple headers.
|
||||
*/
|
||||
/** <P>Includes all tuple headers.</P> */
|
||||
|
||||
#include <boost/preprocessor/tuple/eat.hpp>
|
||||
#include <boost/preprocessor/tuple/elem.hpp>
|
||||
|
@ -13,23 +13,18 @@
|
||||
* See http://www.boost.org for most recent version.
|
||||
*/
|
||||
|
||||
/** \file
|
||||
/** <P>Expands to a macro that eats a tuple of the specified length.</P>
|
||||
|
||||
<a href="../../../../boost/preprocessor/tuple/eat.hpp">Click here to see the header.</a>
|
||||
*/
|
||||
<P>BOOST_PP_TUPLE_EAT() is designed to be used with BOOST_PP_IF() like
|
||||
BOOST_PP_EMPTY().</P>
|
||||
|
||||
/** Expands to a macro that eats a tuple of the specified length.
|
||||
<P>For example,</P>
|
||||
|
||||
BOOST_PP_TUPLE_EAT() is designed to be used with BOOST_PP_IF() like
|
||||
BOOST_PP_EMPTY().
|
||||
|
||||
For example,
|
||||
|
||||
<PRE>\verbatim
|
||||
<PRE>
|
||||
BOOST_PP_IF(0,BOOST_PP_ENUM_PARAMS,BOOST_PP_TUPLE_EAT(2))(10,P)
|
||||
\endverbatim</PRE>
|
||||
</PRE>
|
||||
|
||||
expands to nothing.
|
||||
<P>expands to nothing.</P>
|
||||
*/
|
||||
#define BOOST_PP_TUPLE_EAT(N) BOOST_PP_TUPLE_EAT_DELAY(N)
|
||||
|
||||
|
@ -13,33 +13,30 @@
|
||||
* See http://www.boost.org for most recent version.
|
||||
*/
|
||||
|
||||
/** \file
|
||||
/** <P>Expands to the I:th element of an N-tuple.</P>
|
||||
|
||||
<a href="../../../../boost/preprocessor/tuple/elem.hpp">Click here to see the header.</a>
|
||||
*/
|
||||
<P>For example,</P>
|
||||
|
||||
/** Expands to the I:th element of an N-tuple.
|
||||
|
||||
For example,
|
||||
|
||||
<PRE>\verbatim
|
||||
<PRE>
|
||||
BOOST_PP_TUPLE_ELEM(2,1,(A,B))
|
||||
\endverbatim</PRE>
|
||||
</PRE>
|
||||
|
||||
expands to B.
|
||||
<P>expands to B.</P>
|
||||
|
||||
Tuples can be used for representing structured data.
|
||||
<P>Tuples can be used for representing structured data.</P>
|
||||
|
||||
Examples of tuples:
|
||||
<P>Examples of tuples:</P>
|
||||
|
||||
<PRE>\verbatim
|
||||
<PRE>
|
||||
2-tuple: (A, B)
|
||||
3-tuple: (1, 2, 3)
|
||||
4-tuple: (A B C, D, EF, 34)
|
||||
\endverbatim</PRE>
|
||||
</PRE>
|
||||
|
||||
<H3>See</H3>
|
||||
- BOOST_PP_LIMIT_TUPLE
|
||||
<UL>
|
||||
<LI>BOOST_PP_LIMIT_TUPLE
|
||||
</UL>
|
||||
*/
|
||||
#define BOOST_PP_TUPLE_ELEM(N,I,T) BOOST_PP_TUPLE_ELEM_DELAY(N,I,T)
|
||||
|
||||
@ -215,6 +212,6 @@ Examples of tuples:
|
||||
#define BOOST_PP_TUPLE16_ELEM15(A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P) P
|
||||
#endif
|
||||
|
||||
/** Obsolete. Use BOOST_PP_TUPLE_ELEM(). */
|
||||
/** <P>Obsolete. Use BOOST_PP_TUPLE_ELEM().</P> */
|
||||
#define BOOST_PREPROCESSOR_TUPLE_ELEM(N,I,T) BOOST_PP_TUPLE_ELEM(N,I,T)
|
||||
#endif
|
||||
|
@ -13,18 +13,15 @@
|
||||
* See http://www.boost.org for most recent version.
|
||||
*/
|
||||
|
||||
/** \file
|
||||
|
||||
<a href="../../../../boost/preprocessor/tuple/to_list.hpp">Click here to see the header.</a>
|
||||
*/
|
||||
|
||||
#include <boost/preprocessor/list/adt.hpp>
|
||||
|
||||
/** Converts a tuple to a list.
|
||||
/** <P>Converts a tuple to a list.</P>
|
||||
|
||||
<H3>See</H3>
|
||||
- BOOST_PP_LIST_CONS()
|
||||
- BOOST_PP_LIMIT_TUPLE
|
||||
<UL>
|
||||
<LI>BOOST_PP_LIST_CONS()
|
||||
<LI>BOOST_PP_LIMIT_TUPLE
|
||||
</UL>
|
||||
*/
|
||||
#define BOOST_PP_TUPLE_TO_LIST(N,T) BOOST_PP_TUPLE_TO_LIST_DELAY(N,T)
|
||||
|
||||
|
@ -13,56 +13,54 @@
|
||||
* See http://www.boost.org for most recent version.
|
||||
*/
|
||||
|
||||
/** \file
|
||||
|
||||
<a href="../../../../boost/preprocessor/while.hpp">Click here to see the header.</a>
|
||||
*/
|
||||
|
||||
#include <boost/preprocessor/if.hpp>
|
||||
#include <boost/preprocessor/tuple/eat.hpp>
|
||||
|
||||
/** Iterates F(D,X) while C(D,X) is true.
|
||||
/** <P>Iterates F(D,X) while C(D,X) is true.</P>
|
||||
|
||||
In other words, expands to:
|
||||
<P>In other words, expands to:</P>
|
||||
|
||||
<PRE>\verbatim
|
||||
<PRE>
|
||||
F(D, ... F(D, F(D,X) ) ... )
|
||||
\endverbatim</PRE>
|
||||
</PRE>
|
||||
|
||||
The depth of iteration is determined by C(D,X).
|
||||
<P>The depth of iteration is determined by C(D,X).</P>
|
||||
|
||||
<H3>Legend</H3>
|
||||
|
||||
- <B>X</B> is the current state of iteration. The state is usually a tuple.
|
||||
- <B>C</B> is the condition for iteration. It must expand to a decimal
|
||||
<UL>
|
||||
<LI><B>X</B> is the current state of iteration. The state is usually a tuple.
|
||||
<LI><B>C</B> is the condition for iteration. It must expand to a decimal
|
||||
integer literal.
|
||||
- <B>F</B> is the iterated macro. Note that if the state is a tuple, then
|
||||
<LI><B>F</B> is the iterated macro. Note that if the state is a tuple, then
|
||||
F(D,X) usually expands to a tuple of the same number of elements.
|
||||
- <B>D</B> is the recursion depth and should only be used as a parameter
|
||||
to other macros using BOOST_PP_WHILE(). Such macros include BOOST_PP_ADD()
|
||||
and other arithmetic operations. For each macro using BOOST_PP_WHILE(),
|
||||
there is a version of the macro, distinguished by the D suffix (e.g.
|
||||
BOOST_PP_ADD_D()), that accepts an additional recursion depth as the first
|
||||
parameter. This technique is necessary to avoid recursively expanding the
|
||||
same macro again, which is not permitted by the C++ preprocessor.
|
||||
<LI><B>D</B> is the recursion depth and should only be used as a parameter
|
||||
to other macros using BOOST_PP_WHILE(). Such macros include
|
||||
BOOST_PP_ADD() and other arithmetic operations. For each macro using
|
||||
BOOST_PP_WHILE(), there is a version of the macro, distinguished by the
|
||||
D suffix (e.g. BOOST_PP_ADD_D()), that accepts an additional recursion
|
||||
depth as the first parameter. This technique is necessary to avoid
|
||||
recursively expanding the same macro again, which is not permitted by the
|
||||
C++ preprocessor.
|
||||
</UL>
|
||||
|
||||
NOTE: The value of the D parameter may exceed BOOST_PP_LIMIT_MAG.
|
||||
<P>NOTE: The value of the D parameter may exceed BOOST_PP_LIMIT_MAG.</P>
|
||||
|
||||
<H3>Caveat</H3>
|
||||
|
||||
Using BOOST_PP_WHILE() is a bit tricky. This is due to the C++ preprocessor
|
||||
<P>Using BOOST_PP_WHILE() is a bit tricky. This is due to the C++ preprocessor
|
||||
limitations. It is recommended to take a look at the implementations of the
|
||||
various PREPROCESSOR library primitives such as BOOST_PP_ADD() for additional
|
||||
examples.
|
||||
examples.</P>
|
||||
|
||||
<H3>Example</H3>
|
||||
<UL>
|
||||
<LI><a href="../../example/count_down.c">count_down.c</a>
|
||||
</UL>
|
||||
|
||||
- <a href="../../example/count_down.c">count_down.c</a>
|
||||
<P>For a more complex example, let's take a look at an implementation of
|
||||
BOOST_PP_MUL().</P>
|
||||
|
||||
For a more complex example, let's take a look at an implementation of
|
||||
BOOST_PP_MUL().
|
||||
|
||||
<PRE>\verbatim
|
||||
<PRE>
|
||||
#define BOOST_PP_MUL(X,Y) BOOST_PP_MUL_D(0,X,Y)
|
||||
// Since the macro is implemented using WHILE, the actual implementation
|
||||
// takes a depth as a parameter so that it can be called inside a WHILE.
|
||||
@ -95,12 +93,13 @@ BOOST_PP_MUL().
|
||||
// , The multiplier is retained without change.
|
||||
// , The counter is decreased.
|
||||
// )
|
||||
\endverbatim</PRE>
|
||||
</PRE>
|
||||
|
||||
<H3>Implementation rationale</H3>
|
||||
|
||||
- The maximum iteration depth is greater than 2*BOOST_PP_LIMIT_MAG to make
|
||||
<UL>
|
||||
<LI>The maximum iteration depth is greater than 2*BOOST_PP_LIMIT_MAG to make
|
||||
it possible to compute N*N functions.
|
||||
</UL>
|
||||
*/
|
||||
#define BOOST_PP_WHILE(C,F,X) BOOST_PP_WHILE_C(C(1,X),0,X)(C,F,F(1,X))
|
||||
|
||||
|
Reference in New Issue
Block a user