Added ???_R and ???_D macros to reference

[SVN r12910]
This commit is contained in:
Vesa Karvonen
2002-02-23 10:50:32 +00:00
parent dba7ae68c7
commit 5fa1ddda5a
60 changed files with 173 additions and 3 deletions

View File

@ -35,6 +35,7 @@ single token).</p>
*/
#define BOOST_PP_ADD(X,Y) BOOST_PP_ADD_D(0,X,Y)
/** <p>Can be used inside BOOST_PP_WHILE().</p> */
#define BOOST_PP_ADD_D(D,X,Y) BOOST_PP_TUPLE_ELEM(2,0,BOOST_PP_WHILE##D(BOOST_PP_ADD_C,BOOST_PP_ADD_F,(X,Y)))
#if !defined(BOOST_NO_COMPILER_CONFIG) && defined(__MWERKS__) && __MWERKS__ <= 0x2406
# define BOOST_PP_ADD_C(D,P) BOOST_PP_TUPLE_ELEM(2,1,P)

View File

@ -33,6 +33,7 @@ single token).</p>
*/
#define BOOST_PP_DIV(X,Y) BOOST_PP_DIV_D(0,X,Y)
/** <p>Can be used inside BOOST_PP_WHILE().</p> */
#define BOOST_PP_DIV_D(D,X,Y) BOOST_PP_TUPLE_ELEM(3,0,BOOST_PP_WHILE##D(BOOST_PP_DIV_C,BOOST_PP_DIV_F,(0,X,Y)))
#if !defined(BOOST_NO_COMPILER_CONFIG) && defined(__MWERKS__) && __MWERKS__ <= 0x2406
# define BOOST_PP_DIV_C(D,P) BOOST_PP_LESS_EQUAL_D(D,BOOST_PP_TUPLE_ELEM(3,2,P),BOOST_PP_TUPLE_ELEM(3,1,P))

View File

@ -32,6 +32,7 @@ single token).</p>
*/
#define BOOST_PP_MOD(X,Y) BOOST_PP_MOD_D(0,X,Y)
/** <p>Can be used inside BOOST_PP_WHILE().</p> */
#define BOOST_PP_MOD_D(D,X,Y) BOOST_PP_TUPLE_ELEM(2,0,BOOST_PP_WHILE##D(BOOST_PP_MOD_C,BOOST_PP_MOD_F,(X,Y)))
#define BOOST_PP_MOD_C(D,P) BOOST_PP_LESS_EQUAL_D(D,BOOST_PP_TUPLE2_ELEM1 P,BOOST_PP_TUPLE2_ELEM0 P)
#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)

View File

@ -32,6 +32,7 @@ single token).</p>
*/
#define BOOST_PP_MUL(X,Y) BOOST_PP_MUL_D(0,X,Y)
/** <p>Can be used inside BOOST_PP_WHILE().</p> */
#define BOOST_PP_MUL_D(D,X,Y) BOOST_PP_TUPLE_ELEM(3,0,BOOST_PP_WHILE##D(BOOST_PP_MUL_C,BOOST_PP_MUL_F,(0,X,Y)))
#if !defined(BOOST_NO_COMPILER_CONFIG) && defined(__MWERKS__) && __MWERKS__ <= 0x2406
# define BOOST_PP_MUL_C(D,P) BOOST_PP_TUPLE_ELEM(3,2,P)

View File

@ -34,6 +34,7 @@ single token).</p>
*/
#define BOOST_PP_SUB(X,Y) BOOST_PP_SUB_D(0,X,Y)
/** <p>Can be used inside BOOST_PP_WHILE().</p> */
#define BOOST_PP_SUB_D(D,X,Y) BOOST_PP_TUPLE_ELEM(2,0,BOOST_PP_WHILE##D(BOOST_PP_SUB_C,BOOST_PP_SUB_F,(X,Y)))
#if !defined(BOOST_NO_COMPILER_CONFIG) && defined(__MWERKS__) && __MWERKS__ <= 0x2406
# define BOOST_PP_SUB_C(D,P) BOOST_PP_TUPLE_ELEM(2,1,P)

View File

@ -31,6 +31,7 @@ otherwise.</p>
*/
#define BOOST_PP_EQUAL(X,Y) BOOST_PP_EQUAL_D(0,X,Y)
/** <p>Can be used inside BOOST_PP_WHILE().</p> */
#define BOOST_PP_EQUAL_D(D,X,Y) BOOST_PP_NOT(BOOST_PP_NOT_EQUAL_D(D,X,Y))
/** <p>Obsolete. Use BOOST_PP_EQUAL().</p> */

View File

@ -30,6 +30,7 @@ otherwise.</p>
*/
#define BOOST_PP_GREATER(X,Y) BOOST_PP_GREATER_D(0,X,Y)
/** <p>Can be used inside BOOST_PP_WHILE().</p> */
#define BOOST_PP_GREATER_D(D,X,Y) BOOST_PP_LESS_D(D,Y,X)
/** <p>Obsolete. Use BOOST_PP_GREATER().</p> */

View File

@ -30,6 +30,7 @@ otherwise.</p>
*/
#define BOOST_PP_GREATER_EQUAL(X,Y) BOOST_PP_GREATER_EQUAL_D(0,X,Y)
/** <p>Can be used inside BOOST_PP_WHILE().</p> */
#define BOOST_PP_GREATER_EQUAL_D(D,X,Y) BOOST_PP_LESS_EQUAL_D(D,Y,X)
/** <p>Obsolete. Use BOOST_PP_GREATER_EQUAL().</p> */

View File

@ -32,6 +32,7 @@ otherwise.</p>
*/
#define BOOST_PP_LESS(X,Y) BOOST_PP_LESS_D(0,X,Y)
/** <p>Can be used inside BOOST_PP_WHILE().</p> */
#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))
/** <p>Obsolete. Use BOOST_PP_LESS().</p> */

View File

@ -31,6 +31,7 @@ otherwise.</p>
*/
#define BOOST_PP_LESS_EQUAL(X,Y) BOOST_PP_LESS_EQUAL_D(0,X,Y)
/** <p>Can be used inside BOOST_PP_WHILE().</p> */
#define BOOST_PP_LESS_EQUAL_D(D,X,Y) BOOST_PP_NOT(BOOST_PP_SUB_D(D,X,Y))
/** <p>Obsolete. Use BOOST_PP_LESS_EQUAL().</p> */

View File

@ -32,6 +32,7 @@ otherwise.</p>
*/
#define BOOST_PP_NOT_EQUAL(X,Y) BOOST_PP_NOT_EQUAL_D(0,X,Y)
/** <p>Can be used inside BOOST_PP_WHILE().</p> */
#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)))
/** <p>Obsolete. Use BOOST_PP_NOT_EQUAL().</p> */

View File

@ -44,6 +44,7 @@
*/
#define BOOST_PP_LIST_APPEND(L,P) BOOST_PP_LIST_APPEND_D(0,L,P)
/** <p>Can be used inside BOOST_PP_WHILE().</p> */
#define BOOST_PP_LIST_APPEND_D(D,L,P) BOOST_PP_LIST_FOLD_RIGHT_D(D,BOOST_PP_LIST_APPEND_F,L,P)
#define BOOST_PP_LIST_APPEND_F(D,H,P) (H,P,1)
#endif

View File

@ -38,5 +38,6 @@ first element is at index <code>0</code>.</p>
*/
#define BOOST_PP_LIST_AT(L,I) BOOST_PP_LIST_AT_D(0,L,I)
/** <p>Can be used inside BOOST_PP_WHILE().</p> */
#define BOOST_PP_LIST_AT_D(D,L,I) BOOST_PP_LIST_FIRST(BOOST_PP_LIST_REST_N_D(D,I,L))
#endif

View File

@ -42,6 +42,7 @@
*/
#define BOOST_PP_LIST_CAT(L) BOOST_PP_LIST_CAT_D(0,L)
/** <p>Can be used inside BOOST_PP_WHILE().</p> */
#define BOOST_PP_LIST_CAT_D(D,L) BOOST_PP_LIST_FOLD_LEFT_D(D,BOOST_PP_LIST_CAT_F,BOOST_PP_TUPLE3_ELEM0 L,BOOST_PP_TUPLE3_ELEM1 L)
#define BOOST_PP_LIST_CAT_F(D,P,H) BOOST_PP_CAT(P,H)
#endif

View File

@ -39,6 +39,7 @@
*/
#define BOOST_PP_LIST_ENUM(L) BOOST_PP_LIST_ENUM_R(0,L)
/** <p>Can be used inside BOOST_PP_FOR().</p> */
#define BOOST_PP_LIST_ENUM_R(R,L) BOOST_PP_FOR##R((L,BOOST_PP_EMPTY),BOOST_PP_LIST_ENUM_C,BOOST_PP_LIST_ENUM_F,BOOST_PP_LIST_ENUM_I)
#define BOOST_PP_LIST_ENUM_C(R,P) BOOST_PP_TUPLE_ELEM(3,2,BOOST_PP_TUPLE_ELEM(2,0,P))
#define BOOST_PP_LIST_ENUM_F(R,P) (BOOST_PP_TUPLE_ELEM(3,1,BOOST_PP_TUPLE_ELEM(2,0,P)),BOOST_PP_COMMA)

View File

@ -42,6 +42,7 @@ for which <code>F(D,P,X)</code> is true.</p>
*/
#define BOOST_PP_LIST_FILTER(F,P,L) BOOST_PP_LIST_FILTER_D(0,F,P,L)
/** <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
# 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)))

View File

@ -49,6 +49,7 @@
*/
#define BOOST_PP_LIST_FIRST_N(N,L) BOOST_PP_LIST_FIRST_N_D(0,N,L)
/** <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
# define BOOST_PP_LIST_FIRST_N_C(D,X) BOOST_PP_TUPLE_ELEM(3,2,X)

View File

@ -52,6 +52,7 @@ list <code>L</code> (from the left or the start of the list).</p>
*/
#define BOOST_PP_LIST_FOLD_LEFT(F,P,L) BOOST_PP_LIST_FOLD_LEFT_D(0,F,P,L)
/** <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
# define BOOST_PP_LIST_FOLD_LEFT_C(D,X) BOOST_PP_TUPLE_ELEM(3,2,BOOST_PP_TUPLE_ELEM(3,2,X))

View File

@ -19,6 +19,7 @@
/** <p>Same as BOOST_PP_FOLD_LEFT(), but is implemented independently.</p> */
#define BOOST_PP_LIST_FOLD_LEFT_2ND(F,P,L) BOOST_PP_LIST_FOLD_LEFT_2ND_D(0,F,P,L)
/** <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
# define BOOST_PP_LIST_FOLD_LEFT_2ND_C(D,X) BOOST_PP_TUPLE_ELEM(3,2,BOOST_PP_TUPLE_ELEM(3,2,X))

View File

@ -48,6 +48,7 @@ list <code>L</code> (from the right or the end of the list).</p>
*/
#define BOOST_PP_LIST_FOLD_RIGHT(F,L,P) BOOST_PP_LIST_FOLD_RIGHT_D(0,F,L,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
# 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)))

View File

@ -19,6 +19,7 @@
/** <p>Same as BOOST_PP_LIST_FOLD_RIGHT(), but is implemented independently.</p> */
#define BOOST_PP_LIST_FOLD_RIGHT_2ND(F,L,P) BOOST_PP_LIST_FOLD_RIGHT_2ND_D(0,F,L,P)
/** <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
# 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)))

View File

@ -45,6 +45,7 @@ BOOST_PP_LIST_SIZE(L)[.</p>
*/
#define BOOST_PP_LIST_FOR_EACH(F,P,L) BOOST_PP_LIST_FOR_EACH_R(0,F,P,L)
/** <p>Can be used inside BOOST_PP_FOR().</p> */
#define BOOST_PP_LIST_FOR_EACH_R(R,F,P,L) BOOST_PP_FOR##R((F,P,L),BOOST_PP_LIST_FOR_EACH_C,BOOST_PP_LIST_FOR_EACH_F,BOOST_PP_LIST_FOR_EACH_I)
#define BOOST_PP_LIST_FOR_EACH_C(R,FPL) BOOST_PP_TUPLE_ELEM(3,2,BOOST_PP_TUPLE_ELEM(3,2,FPL))
#define BOOST_PP_LIST_FOR_EACH_F(R,FPL) (BOOST_PP_TUPLE_ELEM(3,0,FPL),BOOST_PP_TUPLE_ELEM(3,1,FPL),BOOST_PP_TUPLE_ELEM(3,1,BOOST_PP_TUPLE_ELEM(3,2,FPL)))

View File

@ -43,6 +43,7 @@ explosion.</p>
*/
#define BOOST_PP_LIST_FOR_EACH_PRODUCT(F,N,T_OF_L) BOOST_PP_LIST_FOR_EACH_PRODUCT_R(0,F,N,T_OF_L)
/** <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 ||\
!defined(BOOST_NO_COMPILER_CONFIG) && defined(_MSC_VER)

View File

@ -49,6 +49,7 @@ list <code>L</code>.</p>
*/
#define BOOST_PP_LIST_REST_N(N,L) BOOST_PP_LIST_REST_N_D(0,N,L)
/** <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
# define BOOST_PP_LIST_REST_N_C(D,X) BOOST_PP_TUPLE_ELEM(2,1,X)

View File

@ -41,6 +41,7 @@
*/
#define BOOST_PP_LIST_REVERSE(L) BOOST_PP_LIST_REVERSE_D(0,L)
/** <p>Can be used inside BOOST_PP_WHILE().</p> */
#define BOOST_PP_LIST_REVERSE_D(D,L) BOOST_PP_LIST_FOLD_LEFT_D(D,BOOST_PP_LIST_REVERSE_F,(_,_,0),L)
#define BOOST_PP_LIST_REVERSE_F(D,P,H) (H,P,1)
#endif

View File

@ -38,6 +38,7 @@
*/
#define BOOST_PP_LIST_SIZE(L) BOOST_PP_LIST_SIZE_D(0,L)
/** <p>Can be used inside BOOST_PP_WHILE().</p> */
#define BOOST_PP_LIST_SIZE_D(D,L) BOOST_PP_LIST_FOLD_LEFT_D(D,BOOST_PP_LIST_SIZE_F,0,L)
#define BOOST_PP_LIST_SIZE_F(D,P,H) BOOST_PP_INC(P)
#endif

View File

@ -43,5 +43,6 @@
*/
#define BOOST_PP_LIST_TO_TUPLE(L) BOOST_PP_LIST_TO_TUPLE_R(0,L)
/** <p>Can be used inside BOOST_PP_FOR().</p> */
#define BOOST_PP_LIST_TO_TUPLE_R(D,L) (BOOST_PP_LIST_ENUM_R(D,L))
#endif

View File

@ -52,6 +52,7 @@ of the list producing a new list.</p>
*/
#define BOOST_PP_LIST_TRANSFORM(F,P,L) BOOST_PP_LIST_TRANSFORM_D(0,F,P,L)
/** <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
# 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))

View File

@ -33,6 +33,7 @@ single token).</p>
*/
#define BOOST_PP_MAX(X,Y) BOOST_PP_MAX_D(0,X,Y)
/** <p>Can be used inside BOOST_PP_WHILE().</p> */
#define BOOST_PP_MAX_D(D,X,Y) BOOST_PP_IF(BOOST_PP_LESS_EQUAL_D(D,X,Y),Y,X)
/** <p>Obsolete. Use BOOST_PP_MAX().</p> */

View File

@ -33,6 +33,7 @@ single token).</p>
*/
#define BOOST_PP_MIN(X,Y) BOOST_PP_MIN_D(0,X,Y)
/** <p>Can be used inside BOOST_PP_WHILE().</p> */
#define BOOST_PP_MIN_D(D,X,Y) BOOST_PP_IF(BOOST_PP_LESS_EQUAL_D(D,Y,X),Y,X)
/** <p>Obsolete. Use BOOST_PP_MIN().</p> */