forked from boostorg/preprocessor
Removed MWCW version number test from workarounds
[SVN r13166]
This commit is contained in:
@ -70,14 +70,14 @@ and BOOST_PP_LIST_FOLD_RIGHT_2ND():</p>
|
||||
#define BOOST_PP_LIST_NIL (_,_,0)
|
||||
|
||||
/** <p>Expands to 1 if the list is not nil and 0 otherwise.</p> */
|
||||
#if !defined(BOOST_NO_COMPILER_CONFIG) && defined(__MWERKS__) && __MWERKS__ <= 0x2406
|
||||
#if !defined(BOOST_NO_COMPILER_CONFIG) && defined(__MWERKS__)
|
||||
# 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> */
|
||||
#if !defined(BOOST_NO_COMPILER_CONFIG) && defined(__MWERKS__) && __MWERKS__ <= 0x2406
|
||||
#if !defined(BOOST_NO_COMPILER_CONFIG) && defined(__MWERKS__)
|
||||
# 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)
|
||||
@ -93,7 +93,7 @@ and BOOST_PP_LIST_FOLD_RIGHT_2ND():</p>
|
||||
|
||||
<p>expands to 1.</p>
|
||||
*/
|
||||
#if !defined(BOOST_NO_COMPILER_CONFIG) && defined(__MWERKS__) && __MWERKS__ <= 0x2406
|
||||
#if !defined(BOOST_NO_COMPILER_CONFIG) && defined(__MWERKS__)
|
||||
# define BOOST_PP_LIST_FIRST(L) BOOST_PP_TUPLE_ELEM(3,0,L)
|
||||
#else
|
||||
# define BOOST_PP_LIST_FIRST(L) BOOST_PP_TUPLE3_ELEM0 L
|
||||
@ -115,7 +115,7 @@ and BOOST_PP_LIST_FOLD_RIGHT_2ND():</p>
|
||||
BOOST_PP_TUPLE_TO_LIST(4,(2,3,4,5))
|
||||
</pre>
|
||||
*/
|
||||
#if !defined(BOOST_NO_COMPILER_CONFIG) && defined(__MWERKS__) && __MWERKS__ <= 0x2406
|
||||
#if !defined(BOOST_NO_COMPILER_CONFIG) && defined(__MWERKS__)
|
||||
# define BOOST_PP_LIST_REST(L) BOOST_PP_TUPLE_ELEM(3,1,L)
|
||||
#else
|
||||
# define BOOST_PP_LIST_REST(L) BOOST_PP_TUPLE3_ELEM1 L
|
||||
|
@ -45,7 +45,7 @@ for which <code>F(D,P,X)</code> is true.</p>
|
||||
|
||||
/** <p>Can be used inside BOOST_PP_WHILE().</p> */
|
||||
#define BOOST_PP_LIST_FILTER_D(D,F,P,L) BOOST_PP_TUPLE_ELEM(3,2,BOOST_PP_LIST_FOLD_RIGHT_D(D,BOOST_PP_LIST_FILTER_F,L,(F,P,(_,_,0))))
|
||||
#if !defined(BOOST_NO_COMPILER_CONFIG) && defined(__MWERKS__) && __MWERKS__ <= 0x2406
|
||||
#if !defined(BOOST_NO_COMPILER_CONFIG) && defined(__MWERKS__)
|
||||
# define BOOST_PP_LIST_FILTER_F(D,H,P) (BOOST_PP_TUPLE_ELEM(3,0,P),BOOST_PP_TUPLE_ELEM(3,1,P),BOOST_PP_IF(BOOST_PP_TUPLE_ELEM(3,0,P)(D,BOOST_PP_TUPLE3_ELEM1 P,H),BOOST_PP_LIST_CONS,BOOST_PP_TUPLE2_ELEM1)(H,BOOST_PP_TUPLE_ELEM(3,2,P)))
|
||||
#elif !defined(BOOST_NO_COMPILER_CONFIG) && defined(_MSC_VER)
|
||||
# define BOOST_PP_LIST_FILTER_F(D,H,P) (BOOST_PP_TUPLE_ELEM(3,0,P),BOOST_PP_TUPLE3_ELEM1 P,BOOST_PP_IF(BOOST_PP_TUPLE3_ELEM0 P(D,BOOST_PP_TUPLE3_ELEM1 P,H),BOOST_PP_LIST_CONS,BOOST_PP_TUPLE2_ELEM1)(H,BOOST_PP_TUPLE3_ELEM2 P))
|
||||
|
@ -51,7 +51,7 @@
|
||||
|
||||
/** <p>Can be used inside BOOST_PP_WHILE().</p> */
|
||||
#define BOOST_PP_LIST_FIRST_N_D(D,N,L) BOOST_PP_LIST_REVERSE_D(D,BOOST_PP_TUPLE_ELEM(3,0,BOOST_PP_WHILE##D(BOOST_PP_LIST_FIRST_N_C,BOOST_PP_LIST_FIRST_N_F,((_,_,0),L,N))))
|
||||
#if !defined(BOOST_NO_COMPILER_CONFIG) && defined(__MWERKS__) && __MWERKS__ <= 0x2406
|
||||
#if !defined(BOOST_NO_COMPILER_CONFIG) && defined(__MWERKS__)
|
||||
# define BOOST_PP_LIST_FIRST_N_C(D,X) BOOST_PP_TUPLE_ELEM(3,2,X)
|
||||
# define BOOST_PP_LIST_FIRST_N_F(D,X) ((BOOST_PP_TUPLE_ELEM(3,0,BOOST_PP_TUPLE_ELEM(3,1,X)),BOOST_PP_TUPLE_ELEM(3,0,X),1),BOOST_PP_TUPLE_ELEM(3,1,BOOST_PP_TUPLE_ELEM(3,1,X)),BOOST_PP_DEC(BOOST_PP_TUPLE_ELEM(3,2,X)))
|
||||
#else
|
||||
|
@ -29,6 +29,19 @@ list <code>L</code> (from the left or the start of the list).</p>
|
||||
)
|
||||
</pre>
|
||||
|
||||
<p>For example,</p>
|
||||
|
||||
<pre>
|
||||
#define TEST(D,P,X) BOOST_PP_CAT(P,X)
|
||||
BOOST_PP_FOLD_LEFT(TEST,_,BOOST_PP_TUPLE_TO_LIST(3,(A,B,C)))
|
||||
</pre>
|
||||
|
||||
<p>expands to:</p>
|
||||
|
||||
<pre>
|
||||
_ABC
|
||||
</pre>
|
||||
|
||||
<h3>Note</h3>
|
||||
<ul>
|
||||
<li>Folding, or accumulation, is a very general pattern of computation.
|
||||
@ -54,7 +67,7 @@ list <code>L</code> (from the left or the start of the list).</p>
|
||||
|
||||
/** <p>Can be used inside BOOST_PP_WHILE().</p> */
|
||||
#define BOOST_PP_LIST_FOLD_LEFT_D(D,F,P,L) BOOST_PP_TUPLE_ELEM(3,1,BOOST_PP_WHILE##D(BOOST_PP_LIST_FOLD_LEFT_C,BOOST_PP_LIST_FOLD_LEFT_F,(F,P,L)))
|
||||
#if !defined(BOOST_NO_COMPILER_CONFIG) && defined(__MWERKS__) && __MWERKS__ <= 0x2406
|
||||
#if !defined(BOOST_NO_COMPILER_CONFIG) && defined(__MWERKS__)
|
||||
# define BOOST_PP_LIST_FOLD_LEFT_C(D,X) BOOST_PP_TUPLE_ELEM(3,2,BOOST_PP_TUPLE_ELEM(3,2,X))
|
||||
# define BOOST_PP_LIST_FOLD_LEFT_F(D,X) (BOOST_PP_TUPLE_ELEM(3,0,X),BOOST_PP_TUPLE_ELEM(3,0,X)(D,BOOST_PP_TUPLE_ELEM(3,1,X),BOOST_PP_TUPLE_ELEM(3,0,BOOST_PP_TUPLE_ELEM(3,2,X))),BOOST_PP_TUPLE_ELEM(3,1,BOOST_PP_TUPLE_ELEM(3,2,X)))
|
||||
#elif !defined(BOOST_NO_COMPILER_CONFIG) && defined(_MSC_VER)
|
||||
|
@ -21,7 +21,7 @@
|
||||
|
||||
/** <p>Can be used inside BOOST_PP_WHILE().</p> */
|
||||
#define BOOST_PP_LIST_FOLD_LEFT_2ND_D(D,F,P,L) BOOST_PP_TUPLE_ELEM(3,1,BOOST_PP_WHILE##D(BOOST_PP_LIST_FOLD_LEFT_2ND_C,BOOST_PP_LIST_FOLD_LEFT_2ND_F,(F,P,L)))
|
||||
#if !defined(BOOST_NO_COMPILER_CONFIG) && defined(__MWERKS__) && __MWERKS__ <= 0x2406
|
||||
#if !defined(BOOST_NO_COMPILER_CONFIG) && defined(__MWERKS__)
|
||||
# define BOOST_PP_LIST_FOLD_LEFT_2ND_C(D,X) BOOST_PP_TUPLE_ELEM(3,2,BOOST_PP_TUPLE_ELEM(3,2,X))
|
||||
# define BOOST_PP_LIST_FOLD_LEFT_2ND_F(D,X) (BOOST_PP_TUPLE_ELEM(3,0,X),BOOST_PP_TUPLE_ELEM(3,0,X)(D,BOOST_PP_TUPLE_ELEM(3,1,X),BOOST_PP_TUPLE_ELEM(3,0,BOOST_PP_TUPLE_ELEM(3,2,X))),BOOST_PP_TUPLE_ELEM(3,1,BOOST_PP_TUPLE_ELEM(3,2,X)))
|
||||
#elif !defined(BOOST_NO_COMPILER_CONFIG) && defined(_MSC_VER)
|
||||
|
@ -51,7 +51,7 @@ list <code>L</code> (from the right or the end of the list).</p>
|
||||
|
||||
/** <p>Can be used inside BOOST_PP_WHILE().</p> */
|
||||
#define BOOST_PP_LIST_FOLD_RIGHT_D(D,F,L,P) BOOST_PP_TUPLE_ELEM(2,1,BOOST_PP_LIST_FOLD_LEFT_D(D,BOOST_PP_LIST_FOLD_RIGHT_F,(F,P),BOOST_PP_LIST_REVERSE_D(D,L)))
|
||||
#if !defined(BOOST_NO_COMPILER_CONFIG) && defined(__MWERKS__) && __MWERKS__ <= 0x2406
|
||||
#if !defined(BOOST_NO_COMPILER_CONFIG) && defined(__MWERKS__)
|
||||
# define BOOST_PP_LIST_FOLD_RIGHT_F(D,P,H) (BOOST_PP_TUPLE_ELEM(2,0,P),BOOST_PP_TUPLE_ELEM(2,0,P)(D,H,BOOST_PP_TUPLE_ELEM(2,1,P)))
|
||||
#elif !defined(BOOST_NO_COMPILER_CONFIG) && defined(_MSC_VER)
|
||||
# define BOOST_PP_LIST_FOLD_RIGHT_F(D,P,H) (BOOST_PP_TUPLE_ELEM(2,0,P),BOOST_PP_TUPLE_ELEM(2,0,P)(D,H,BOOST_PP_TUPLE2_ELEM1 P))
|
||||
|
@ -21,7 +21,7 @@
|
||||
|
||||
/** <p>Can be used inside BOOST_PP_WHILE().</p> */
|
||||
#define BOOST_PP_LIST_FOLD_RIGHT_2ND_D(D,F,L,P) BOOST_PP_TUPLE_ELEM(2,1,BOOST_PP_LIST_FOLD_LEFT_2ND_D(D,BOOST_PP_LIST_FOLD_RIGHT_2ND_F,(F,P),BOOST_PP_LIST_FOLD_LEFT_2ND_D(D,BOOST_PP_LIST_REVERSE_F,(_,_,0),L)))
|
||||
#if !defined(BOOST_NO_COMPILER_CONFIG) && defined(__MWERKS__) && __MWERKS__ <= 0x2406
|
||||
#if !defined(BOOST_NO_COMPILER_CONFIG) && defined(__MWERKS__)
|
||||
# define BOOST_PP_LIST_FOLD_RIGHT_2ND_F(D,P,H) (BOOST_PP_TUPLE_ELEM(2,0,P),BOOST_PP_TUPLE_ELEM(2,0,P)(D,H,BOOST_PP_TUPLE_ELEM(2,1,P)))
|
||||
#elif !defined(BOOST_NO_COMPILER_CONFIG) && defined(_MSC_VER)
|
||||
# define BOOST_PP_LIST_FOLD_RIGHT_2ND_F(D,P,H) (BOOST_PP_TUPLE_ELEM(2,0,P),BOOST_PP_TUPLE_ELEM(2,0,P)(D,H,BOOST_PP_TUPLE2_ELEM1 P))
|
||||
|
@ -45,7 +45,7 @@ explosion.</p>
|
||||
|
||||
/** <p>Can be used inside BOOST_PP_FOR().</p> */
|
||||
#define BOOST_PP_LIST_FOR_EACH_PRODUCT_R(R,F,N,T_OF_L) BOOST_PP_LIST_FOR_EACH_PRODUCT_R2(0,F,BOOST_PP_TUPLE_TO_LIST(N,BOOST_PP_TUPLE_REVERSE(N,T_OF_L)))
|
||||
#if !defined(BOOST_NO_COMPILER_CONFIG) && defined(__MWERKS__) && __MWERKS__ <= 0x2406 ||\
|
||||
#if !defined(BOOST_NO_COMPILER_CONFIG) && defined(__MWERKS__) ||\
|
||||
!defined(BOOST_NO_COMPILER_CONFIG) && defined(_MSC_VER)
|
||||
# define BOOST_PP_LIST_FOR_EACH_PRODUCT_R2(R,F,LL) BOOST_PP_FOR##R((BOOST_PP_TUPLE_ELEM(3,0,LL),BOOST_PP_TUPLE_ELEM(3,1,LL),(_,_,0),F),BOOST_PP_LIST_FOR_EACH_PRODUCT_C,BOOST_PP_LIST_FOR_EACH_PRODUCT_F,BOOST_PP_LIST_FOR_EACH_PRODUCT_I0)
|
||||
# define BOOST_PP_LIST_FOR_EACH_PRODUCT_C(R,P) BOOST_PP_TUPLE_ELEM(3,2,BOOST_PP_TUPLE_ELEM(4,0,P))
|
||||
|
@ -51,7 +51,7 @@ list <code>L</code>.</p>
|
||||
|
||||
/** <p>Can be used inside BOOST_PP_WHILE().</p> */
|
||||
#define BOOST_PP_LIST_REST_N_D(D,N,L) BOOST_PP_TUPLE_ELEM(2,0,BOOST_PP_WHILE##D(BOOST_PP_LIST_REST_N_C,BOOST_PP_LIST_REST_N_F,(L,N)))
|
||||
#if !defined(BOOST_NO_COMPILER_CONFIG) && defined(__MWERKS__) && __MWERKS__ <= 0x2406
|
||||
#if !defined(BOOST_NO_COMPILER_CONFIG) && defined(__MWERKS__)
|
||||
# define BOOST_PP_LIST_REST_N_C(D,X) BOOST_PP_TUPLE_ELEM(2,1,X)
|
||||
# define BOOST_PP_LIST_REST_N_F(D,X) (BOOST_PP_TUPLE_ELEM(3,1,BOOST_PP_TUPLE_ELEM(2,0,X)),BOOST_PP_DEC(BOOST_PP_TUPLE_ELEM(2,1,X)))
|
||||
#else
|
||||
|
@ -55,7 +55,7 @@ of the list producing a new list.</p>
|
||||
|
||||
/** <p>Can be used inside BOOST_PP_WHILE().</p> */
|
||||
#define BOOST_PP_LIST_TRANSFORM_D(D,F,P,L) BOOST_PP_TUPLE_ELEM(3,2,BOOST_PP_LIST_FOLD_RIGHT_D(D,BOOST_PP_LIST_TRANSFORM_F,L,(F,P,(_,_,0))))
|
||||
#if !defined(BOOST_NO_COMPILER_CONFIG) && defined(__MWERKS__) && __MWERKS__ <= 0x2406
|
||||
#if !defined(BOOST_NO_COMPILER_CONFIG) && defined(__MWERKS__)
|
||||
# define BOOST_PP_LIST_TRANSFORM_F(D,H,P) (BOOST_PP_TUPLE_ELEM(3,0,P),BOOST_PP_TUPLE_ELEM(3,1,P),(BOOST_PP_TUPLE_ELEM(3,0,P)(D,BOOST_PP_TUPLE_ELEM(3,1,P),H),BOOST_PP_TUPLE_ELEM(3,2,P),1))
|
||||
#elif !defined(BOOST_NO_COMPILER_CONFIG) && defined(_MSC_VER)
|
||||
# define BOOST_PP_LIST_TRANSFORM_F(D,H,P) (BOOST_PP_TUPLE_ELEM(3,0,P),BOOST_PP_TUPLE3_ELEM1 P,(BOOST_PP_TUPLE_ELEM(3,0,P)(D,BOOST_PP_TUPLE3_ELEM1 P,H),BOOST_PP_TUPLE3_ELEM2 P,1))
|
||||
|
Reference in New Issue
Block a user