diff --git a/include/boost/preprocessor/arithmetic/add.hpp b/include/boost/preprocessor/arithmetic/add.hpp index 8a871b2..d7d2c24 100644 --- a/include/boost/preprocessor/arithmetic/add.hpp +++ b/include/boost/preprocessor/arithmetic/add.hpp @@ -35,11 +35,7 @@ single token).
/**Can be used inside BOOST_PP_WHILE() (see for an explanation of the D parameter).
*/ #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__) -# define BOOST_PP_ADD_C(D,RC) BOOST_PP_TUPLE_ELEM(2,1,RC) -# define BOOST_PP_ADD_F(D,RC) (BOOST_PP_INC(BOOST_PP_TUPLE_ELEM(2,0,RC)),BOOST_PP_DEC(BOOST_PP_TUPLE_ELEM(2,1,RC))) -#else -# define BOOST_PP_ADD_C(D,RC) BOOST_PP_TUPLE2_ELEM1 RC -# define BOOST_PP_ADD_F(D,RC) (BOOST_PP_INC(BOOST_PP_TUPLE2_ELEM0 RC),BOOST_PP_DEC(BOOST_PP_TUPLE2_ELEM1 RC)) -#endif + +#define BOOST_PP_ADD_C(D,RC) BOOST_PP_TUPLE_ELEM(2,1,RC) +#define BOOST_PP_ADD_F(D,RC) (BOOST_PP_INC(BOOST_PP_TUPLE_ELEM(2,0,RC)),BOOST_PP_DEC(BOOST_PP_TUPLE_ELEM(2,1,RC))) #endif diff --git a/include/boost/preprocessor/arithmetic/div.hpp b/include/boost/preprocessor/arithmetic/div.hpp index c792358..0074c56 100644 --- a/include/boost/preprocessor/arithmetic/div.hpp +++ b/include/boost/preprocessor/arithmetic/div.hpp @@ -33,11 +33,7 @@ single token). /**Can be used inside BOOST_PP_WHILE() (see for an explanation of the D parameter).
*/ #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__) -# define BOOST_PP_DIV_C(D,RCY) BOOST_PP_LESS_EQUAL_D(D,BOOST_PP_TUPLE_ELEM(3,2,RCY),BOOST_PP_TUPLE_ELEM(3,1,RCY)) -# define BOOST_PP_DIV_F(D,RCY) (BOOST_PP_INC(BOOST_PP_TUPLE_ELEM(3,0,RCY)),BOOST_PP_SUB_D(D,BOOST_PP_TUPLE_ELEM(3,1,RCY),BOOST_PP_TUPLE_ELEM(3,2,RCY)),BOOST_PP_TUPLE_ELEM(3,2,RCY)) -#else -# define BOOST_PP_DIV_C(D,RCY) BOOST_PP_LESS_EQUAL_D(D,BOOST_PP_TUPLE3_ELEM2 RCY,BOOST_PP_TUPLE3_ELEM1 RCY) -# define BOOST_PP_DIV_F(D,RCY) (BOOST_PP_INC(BOOST_PP_TUPLE3_ELEM0 RCY),BOOST_PP_SUB_D(D,BOOST_PP_TUPLE3_ELEM1 RCY,BOOST_PP_TUPLE3_ELEM2 RCY),BOOST_PP_TUPLE3_ELEM2 RCY) -#endif + +#define BOOST_PP_DIV_C(D,RCY) BOOST_PP_LESS_EQUAL_D(D,BOOST_PP_TUPLE_ELEM(3,2,RCY),BOOST_PP_TUPLE_ELEM(3,1,RCY)) +#define BOOST_PP_DIV_F(D,RCY) (BOOST_PP_INC(BOOST_PP_TUPLE_ELEM(3,0,RCY)),BOOST_PP_SUB_D(D,BOOST_PP_TUPLE_ELEM(3,1,RCY),BOOST_PP_TUPLE_ELEM(3,2,RCY)),BOOST_PP_TUPLE_ELEM(3,2,RCY)) #endif diff --git a/include/boost/preprocessor/arithmetic/mod.hpp b/include/boost/preprocessor/arithmetic/mod.hpp index 18f121e..268e220 100644 --- a/include/boost/preprocessor/arithmetic/mod.hpp +++ b/include/boost/preprocessor/arithmetic/mod.hpp @@ -32,6 +32,6 @@ single token). /**Can be used inside BOOST_PP_WHILE() (see for an explanation of the D parameter).
*/ #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,RY) BOOST_PP_LESS_EQUAL_D(D,BOOST_PP_TUPLE2_ELEM1 RY,BOOST_PP_TUPLE2_ELEM0 RY) -#define BOOST_PP_MOD_F(D,RY) (BOOST_PP_SUB_D(D,BOOST_PP_TUPLE2_ELEM0 RY,BOOST_PP_TUPLE2_ELEM1 RY),BOOST_PP_TUPLE2_ELEM1 RY) +#define BOOST_PP_MOD_C(D,RY) BOOST_PP_LESS_EQUAL_D(D,BOOST_PP_TUPLE_ELEM(2,1,RY),BOOST_PP_TUPLE_ELEM(2,0,RY)) +#define BOOST_PP_MOD_F(D,RY) (BOOST_PP_SUB_D(D,BOOST_PP_TUPLE_ELEM(2,0,RY),BOOST_PP_TUPLE_ELEM(2,1,RY)),BOOST_PP_TUPLE_ELEM(2,1,RY)) #endif diff --git a/include/boost/preprocessor/arithmetic/mul.hpp b/include/boost/preprocessor/arithmetic/mul.hpp index c533668..e6af287 100644 --- a/include/boost/preprocessor/arithmetic/mul.hpp +++ b/include/boost/preprocessor/arithmetic/mul.hpp @@ -32,11 +32,7 @@ single token). /**Can be used inside BOOST_PP_WHILE() (see for an explanation of the D parameter).
*/ #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__) -# define BOOST_PP_MUL_C(D,RXC) BOOST_PP_TUPLE_ELEM(3,2,RXC) -# define BOOST_PP_MUL_F(D,RXC) (BOOST_PP_ADD_D(D,BOOST_PP_TUPLE_ELEM(3,0,RXC),BOOST_PP_TUPLE_ELEM(3,1,RXC)),BOOST_PP_TUPLE_ELEM(3,1,RXC),BOOST_PP_DEC(BOOST_PP_TUPLE_ELEM(3,2,RXC))) -#else -# define BOOST_PP_MUL_C(D,RXC) BOOST_PP_TUPLE3_ELEM2 RXC -# define BOOST_PP_MUL_F(D,RXC) (BOOST_PP_ADD_D(D,BOOST_PP_TUPLE3_ELEM0 RXC,BOOST_PP_TUPLE3_ELEM1 RXC),BOOST_PP_TUPLE3_ELEM1 RXC,BOOST_PP_DEC(BOOST_PP_TUPLE3_ELEM2 RXC)) -#endif + +#define BOOST_PP_MUL_C(D,RXC) BOOST_PP_TUPLE_ELEM(3,2,RXC) +#define BOOST_PP_MUL_F(D,RXC) (BOOST_PP_ADD_D(D,BOOST_PP_TUPLE_ELEM(3,0,RXC),BOOST_PP_TUPLE_ELEM(3,1,RXC)),BOOST_PP_TUPLE_ELEM(3,1,RXC),BOOST_PP_DEC(BOOST_PP_TUPLE_ELEM(3,2,RXC))) #endif diff --git a/include/boost/preprocessor/arithmetic/sub.hpp b/include/boost/preprocessor/arithmetic/sub.hpp index f80cf68..7c0844a 100644 --- a/include/boost/preprocessor/arithmetic/sub.hpp +++ b/include/boost/preprocessor/arithmetic/sub.hpp @@ -34,11 +34,7 @@ single token). /**Can be used inside BOOST_PP_WHILE() (see for an explanation of the D parameter).
*/ #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__) -# define BOOST_PP_SUB_C(D,RC) BOOST_PP_TUPLE_ELEM(2,1,RC) -# define BOOST_PP_SUB_F(D,RC) (BOOST_PP_DEC(BOOST_PP_TUPLE_ELEM(2,0,RC)),BOOST_PP_DEC(BOOST_PP_TUPLE_ELEM(2,1,RC))) -#else -# define BOOST_PP_SUB_C(D,RC) BOOST_PP_TUPLE2_ELEM1 RC -# define BOOST_PP_SUB_F(D,RC) (BOOST_PP_DEC(BOOST_PP_TUPLE2_ELEM0 RC),BOOST_PP_DEC(BOOST_PP_TUPLE2_ELEM1 RC)) -#endif + +#define BOOST_PP_SUB_C(D,RC) BOOST_PP_TUPLE_ELEM(2,1,RC) +#define BOOST_PP_SUB_F(D,RC) (BOOST_PP_DEC(BOOST_PP_TUPLE_ELEM(2,0,RC)),BOOST_PP_DEC(BOOST_PP_TUPLE_ELEM(2,1,RC))) #endif diff --git a/include/boost/preprocessor/detail/expand.hpp b/include/boost/preprocessor/detail/expand.hpp new file mode 100644 index 0000000..dde4af0 --- /dev/null +++ b/include/boost/preprocessor/detail/expand.hpp @@ -0,0 +1,15 @@ +#ifndef BOOST_PREPROCESSOR_DETAIL_EXPAND_HPP +#define BOOST_PREPROCESSOR_DETAIL_EXPAND_HPP + +/* Copyright (C) 2002 Vesa Karvonen + * + * Permission to copy, use, modify, sell and distribute this software is + * granted provided this copyright notice appears in all copies. This + * software is provided "as is" without express or implied warranty, and + * with no claim as to its suitability for any purpose. + * + * See http://www.boost.org for most recent version. + */ + +#define BOOST_PP_DETAIL_EXPAND(X) X +#endif diff --git a/include/boost/preprocessor/enum.hpp b/include/boost/preprocessor/enum.hpp index ef899ce..888e9a3 100644 --- a/include/boost/preprocessor/enum.hpp +++ b/include/boost/preprocessor/enum.hpp @@ -103,14 +103,7 @@ are directly supported. #endif - -#if !defined(BOOST_NO_COMPILER_CONFIG) && defined(__MWERKS__) -# define BOOST_PP_ENUM_M1(I,MD) BOOST_PP_COMMA_IF(I) BOOST_PP_TUPLE_ELEM(2,0,MD)(I,BOOST_PP_TUPLE_ELEM(2,1,MD)) -# define BOOST_PP_ENUM_M2(I,MD) BOOST_PP_COMMA_IF(I) BOOST_PP_TUPLE_ELEM(2,0,MD)(I,BOOST_PP_TUPLE_ELEM(2,1,MD)) -# define BOOST_PP_ENUM_M3(I,MD) BOOST_PP_COMMA_IF(I) BOOST_PP_TUPLE_ELEM(2,0,MD)(I,BOOST_PP_TUPLE_ELEM(2,1,MD)) -#else -# define BOOST_PP_ENUM_M1(I,MD) BOOST_PP_COMMA_IF(I) BOOST_PP_TUPLE2_ELEM0 MD(I,BOOST_PP_TUPLE2_ELEM1 MD) -# define BOOST_PP_ENUM_M2(I,MD) BOOST_PP_COMMA_IF(I) BOOST_PP_TUPLE2_ELEM0 MD(I,BOOST_PP_TUPLE2_ELEM1 MD) -# define BOOST_PP_ENUM_M3(I,MD) BOOST_PP_COMMA_IF(I) BOOST_PP_TUPLE2_ELEM0 MD(I,BOOST_PP_TUPLE2_ELEM1 MD) -#endif +#define BOOST_PP_ENUM_M1(I,MD) BOOST_PP_COMMA_IF(I) BOOST_PP_TUPLE_ELEM(2,0,MD)(I,BOOST_PP_TUPLE_ELEM(2,1,MD)) +#define BOOST_PP_ENUM_M2(I,MD) BOOST_PP_COMMA_IF(I) BOOST_PP_TUPLE_ELEM(2,0,MD)(I,BOOST_PP_TUPLE_ELEM(2,1,MD)) +#define BOOST_PP_ENUM_M3(I,MD) BOOST_PP_COMMA_IF(I) BOOST_PP_TUPLE_ELEM(2,0,MD)(I,BOOST_PP_TUPLE_ELEM(2,1,MD)) #endif diff --git a/include/boost/preprocessor/enum_params_with_a_default.hpp b/include/boost/preprocessor/enum_params_with_a_default.hpp index 933eaf8..cb1629d 100644 --- a/include/boost/preprocessor/enum_params_with_a_default.hpp +++ b/include/boost/preprocessor/enum_params_with_a_default.hpp @@ -51,9 +51,5 @@ x0 = y, x1 = y, x2 = y */ #define BOOST_PP_ENUM_PARAMS_WITH_A_DEFAULT(COUNT,PARAM,DEFAULT) BOOST_PP_ENUM(COUNT,BOOST_PP_ENUM_PARAMS_WITH_A_DEFAULT_F,(PARAM,DEFAULT)) -#if !defined(BOOST_NO_COMPILER_CONFIG) && defined(__MWERKS__) -# define BOOST_PP_ENUM_PARAMS_WITH_A_DEFAULT_F(I,PD) BOOST_PP_CAT(BOOST_PP_TUPLE_ELEM(2,0,PD),I)=BOOST_PP_TUPLE_ELEM(2,1,PD) -#else -# define BOOST_PP_ENUM_PARAMS_WITH_A_DEFAULT_F(I,PD) BOOST_PP_CAT(BOOST_PP_TUPLE2_ELEM0 PD,I)=BOOST_PP_TUPLE2_ELEM1 PD -#endif +#define BOOST_PP_ENUM_PARAMS_WITH_A_DEFAULT_F(I,PD) BOOST_PP_CAT(BOOST_PP_TUPLE_ELEM(2,0,PD),I)=BOOST_PP_TUPLE_ELEM(2,1,PD) #endif diff --git a/include/boost/preprocessor/enum_params_with_defaults.hpp b/include/boost/preprocessor/enum_params_with_defaults.hpp index 55abe61..68e75a5 100644 --- a/include/boost/preprocessor/enum_params_with_defaults.hpp +++ b/include/boost/preprocessor/enum_params_with_defaults.hpp @@ -51,9 +51,5 @@ x0 = y0, x1 = y1, x2 = y2 */ #define BOOST_PP_ENUM_PARAMS_WITH_DEFAULTS(COUNT,PARAM,DEFAULT) BOOST_PP_ENUM(COUNT,BOOST_PP_ENUM_PARAMS_WITH_DEFAULTS_F,(PARAM,DEFAULT)) -#if !defined(BOOST_NO_COMPILER_CONFIG) && defined(__MWERKS__) -# define BOOST_PP_ENUM_PARAMS_WITH_DEFAULTS_F(I,PD) BOOST_PP_CAT(BOOST_PP_TUPLE_ELEM(2,0,PD),I)=BOOST_PP_CAT(BOOST_PP_TUPLE_ELEM(2,1,PD),I) -#else -# define BOOST_PP_ENUM_PARAMS_WITH_DEFAULTS_F(I,PD) BOOST_PP_CAT(BOOST_PP_TUPLE2_ELEM0 PD,I)=BOOST_PP_CAT(BOOST_PP_TUPLE2_ELEM1 PD,I) -#endif +#define BOOST_PP_ENUM_PARAMS_WITH_DEFAULTS_F(I,PD) BOOST_PP_CAT(BOOST_PP_TUPLE_ELEM(2,0,PD),I)=BOOST_PP_CAT(BOOST_PP_TUPLE_ELEM(2,1,PD),I) #endif diff --git a/include/boost/preprocessor/enum_shifted.hpp b/include/boost/preprocessor/enum_shifted.hpp index 8a29eaf..f0ba1b4 100644 --- a/include/boost/preprocessor/enum_shifted.hpp +++ b/include/boost/preprocessor/enum_shifted.hpp @@ -46,9 +46,5 @@ X1 x1, X2 x2 */ #define BOOST_PP_ENUM_SHIFTED(COUNT,MACRO,DATA) BOOST_PP_ENUM(BOOST_PP_DEC(COUNT),BOOST_PP_ENUM_SHIFTED_F,(MACRO,DATA)) -#if !defined(BOOST_NO_COMPILER_CONFIG) && defined(__MWERKS__) -# define BOOST_PP_ENUM_SHIFTED_F(I,MD) BOOST_PP_TUPLE_ELEM(2,0,MD)(BOOST_PP_INC(I),BOOST_PP_TUPLE_ELEM(2,1,MD)) -#else -# define BOOST_PP_ENUM_SHIFTED_F(I,MD) BOOST_PP_TUPLE2_ELEM0 MD(BOOST_PP_INC(I),BOOST_PP_TUPLE2_ELEM1 MD) -#endif +#define BOOST_PP_ENUM_SHIFTED_F(I,MD) BOOST_PP_TUPLE_ELEM(2,0,MD)(BOOST_PP_INC(I),BOOST_PP_TUPLE_ELEM(2,1,MD)) #endif diff --git a/include/boost/preprocessor/if.hpp b/include/boost/preprocessor/if.hpp index b7f5a94..1a6266a 100644 --- a/include/boost/preprocessor/if.hpp +++ b/include/boost/preprocessor/if.hpp @@ -15,7 +15,6 @@ #includeExpands to THEN
if COND != 0
and ELSE
if
COND == 0
.
Expands to 1 if the list is not nil and 0 otherwise.
*/ -#if !defined(BOOST_NO_COMPILER_CONFIG) && defined(__MWERKS__) -# define BOOST_PP_LIST_IS_CONS(LIST) BOOST_PP_TUPLE_ELEM(3,2,LIST) -#else -# define BOOST_PP_LIST_IS_CONS(LIST) BOOST_PP_TUPLE3_ELEM2 LIST -#endif +#define BOOST_PP_LIST_IS_CONS(LIST) BOOST_PP_TUPLE_ELEM(3,2,LIST) /**Expands to 1 if the list is nil and 0 otherwise.
*/ -#if !defined(BOOST_NO_COMPILER_CONFIG) && defined(__MWERKS__) -# define BOOST_PP_LIST_IS_NIL(LIST) BOOST_PP_NOT(BOOST_PP_TUPLE_ELEM(3,2,LIST)) -#else -# define BOOST_PP_LIST_IS_NIL(LIST) BOOST_PP_NOT(BOOST_PP_TUPLE3_ELEM2 LIST) -#endif +#define BOOST_PP_LIST_IS_NIL(LIST) BOOST_PP_NOT(BOOST_PP_TUPLE_ELEM(3,2,LIST)) /**Expands to the first element of the list. The list must not be nil.
@@ -94,11 +86,7 @@ BOOST_PP_LIST_FIRST(BOOST_PP_TUPLE_TO_LIST(5,(1,2,3,4,5)))expands to 1.
*/ -#if !defined(BOOST_NO_COMPILER_CONFIG) && defined(__MWERKS__) -# define BOOST_PP_LIST_FIRST(LIST) BOOST_PP_TUPLE_ELEM(3,0,LIST) -#else -# define BOOST_PP_LIST_FIRST(LIST) BOOST_PP_TUPLE3_ELEM0 LIST -#endif +#define BOOST_PP_LIST_FIRST(LIST) BOOST_PP_TUPLE_ELEM(3,0,LIST) /**Expands to a list of all but the first element of the list.
@@ -116,9 +104,5 @@ BOOST_PP_LIST_REST(BOOST_PP_TUPLE_TO_LIST(5,(1,2,3,4,5))) BOOST_PP_TUPLE_TO_LIST(4,(2,3,4,5)) */ -#if !defined(BOOST_NO_COMPILER_CONFIG) && defined(__MWERKS__) -# define BOOST_PP_LIST_REST(LIST) BOOST_PP_TUPLE_ELEM(3,1,LIST) -#else -# define BOOST_PP_LIST_REST(LIST) BOOST_PP_TUPLE3_ELEM1 LIST -#endif +#define BOOST_PP_LIST_REST(LIST) BOOST_PP_TUPLE_ELEM(3,1,LIST) #endif diff --git a/include/boost/preprocessor/list/cat.hpp b/include/boost/preprocessor/list/cat.hpp index 8b77e47..332ff9b 100644 --- a/include/boost/preprocessor/list/cat.hpp +++ b/include/boost/preprocessor/list/cat.hpp @@ -38,6 +38,6 @@ BOOST_PP_LIST_CAT(BOOST_PP_TUPLE_TO_LIST(3,(1,2,3))) #define BOOST_PP_LIST_CAT(LIST) BOOST_PP_LIST_CAT_D(0,LIST) /**Can be used inside BOOST_PP_WHILE() (see for an explanation of the D parameter).
*/ -#define BOOST_PP_LIST_CAT_D(D,LIST) BOOST_PP_LIST_FOLD_LEFT_D(D,BOOST_PP_LIST_CAT_F,BOOST_PP_TUPLE3_ELEM0 LIST,BOOST_PP_TUPLE3_ELEM1 LIST) +#define BOOST_PP_LIST_CAT_D(D,LIST) BOOST_PP_LIST_FOLD_LEFT_D(D,BOOST_PP_LIST_CAT_F,BOOST_PP_TUPLE_ELEM(3,0,LIST),BOOST_PP_TUPLE_ELEM(3,1,LIST)) #define BOOST_PP_LIST_CAT_F(D,S,X) BOOST_PP_CAT(S,X) #endif diff --git a/include/boost/preprocessor/list/filter.hpp b/include/boost/preprocessor/list/filter.hpp index 9c94c4e..6426a08 100644 --- a/include/boost/preprocessor/list/filter.hpp +++ b/include/boost/preprocessor/list/filter.hpp @@ -39,11 +39,6 @@ BOOST_PP_TUPLE_TO_LIST(2,(1,3)) /**Can be used inside BOOST_PP_WHILE() (see for an explanation of the D parameter).
*/ #define BOOST_PP_LIST_FILTER_D(D,PRED,DATA,LIST) BOOST_PP_TUPLE_ELEM(3,2,BOOST_PP_LIST_FOLD_RIGHT_D(D,BOOST_PP_LIST_FILTER_F,LIST,(PRED,DATA,(_,_,0)))) -#if !defined(BOOST_NO_COMPILER_CONFIG) && defined(__MWERKS__) -# define BOOST_PP_LIST_FILTER_F(D,X,PDR) (BOOST_PP_TUPLE_ELEM(3,0,PDR),BOOST_PP_TUPLE_ELEM(3,1,PDR),BOOST_PP_IF(BOOST_PP_TUPLE_ELEM(3,0,PDR)(D,BOOST_PP_TUPLE3_ELEM1 PDR,X),BOOST_PP_LIST_CONS,BOOST_PP_TUPLE2_ELEM1)(X,BOOST_PP_TUPLE_ELEM(3,2,PDR))) -#elif !defined(BOOST_NO_COMPILER_CONFIG) && defined(_MSC_VER) -# define BOOST_PP_LIST_FILTER_F(D,X,PDR) (BOOST_PP_TUPLE_ELEM(3,0,PDR),BOOST_PP_TUPLE3_ELEM1 PDR,BOOST_PP_IF(BOOST_PP_TUPLE3_ELEM0 PDR(D,BOOST_PP_TUPLE3_ELEM1 PDR,X),BOOST_PP_LIST_CONS,BOOST_PP_TUPLE2_ELEM1)(X,BOOST_PP_TUPLE3_ELEM2 PDR)) -#else -# define BOOST_PP_LIST_FILTER_F(D,X,PDR) (BOOST_PP_TUPLE3_ELEM0 PDR,BOOST_PP_TUPLE3_ELEM1 PDR,BOOST_PP_IF(BOOST_PP_TUPLE3_ELEM0 PDR(D,BOOST_PP_TUPLE3_ELEM1 PDR,X),BOOST_PP_LIST_CONS,BOOST_PP_TUPLE2_ELEM1)(X,BOOST_PP_TUPLE3_ELEM2 PDR)) -#endif + +#define BOOST_PP_LIST_FILTER_F(D,X,PDR) (BOOST_PP_TUPLE_ELEM(3,0,PDR),BOOST_PP_TUPLE_ELEM(3,1,PDR),BOOST_PP_IF(BOOST_PP_TUPLE_ELEM(3,0,PDR)(D,BOOST_PP_TUPLE_ELEM(3,1,PDR),X),BOOST_PP_LIST_CONS,BOOST_PP_IF1)(X,BOOST_PP_TUPLE_ELEM(3,2,PDR))) #endif diff --git a/include/boost/preprocessor/list/first_n.hpp b/include/boost/preprocessor/list/first_n.hpp index 0d64d35..6d781d2 100644 --- a/include/boost/preprocessor/list/first_n.hpp +++ b/include/boost/preprocessor/list/first_n.hpp @@ -46,11 +46,8 @@ BOOST_PP_TUPLE_TO_LIST(2,(+,-)) /**Can be used inside BOOST_PP_WHILE() (see for an explanation the D parameter).
*/ #define BOOST_PP_LIST_FIRST_N_D(D,COUNT,LIST) 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),LIST,COUNT)))) -#if !defined(BOOST_NO_COMPILER_CONFIG) && defined(__MWERKS__) -# define BOOST_PP_LIST_FIRST_N_C(D,RLC) BOOST_PP_TUPLE_ELEM(3,2,RLC) -# define BOOST_PP_LIST_FIRST_N_F(D,RLC) ((BOOST_PP_TUPLE_ELEM(3,0,BOOST_PP_TUPLE_ELEM(3,1,RLC)),BOOST_PP_TUPLE_ELEM(3,0,RLC),1),BOOST_PP_TUPLE_ELEM(3,1,BOOST_PP_TUPLE_ELEM(3,1,RLC)),BOOST_PP_DEC(BOOST_PP_TUPLE_ELEM(3,2,RLC))) -#else -# define BOOST_PP_LIST_FIRST_N_C(D,RLC) BOOST_PP_TUPLE3_ELEM2 RLC -# define BOOST_PP_LIST_FIRST_N_F(D,RLC) ((BOOST_PP_TUPLE3_ELEM0 BOOST_PP_TUPLE3_ELEM1 RLC,BOOST_PP_TUPLE3_ELEM0 RLC,1),BOOST_PP_TUPLE3_ELEM1 BOOST_PP_TUPLE3_ELEM1 RLC,BOOST_PP_DEC(BOOST_PP_TUPLE3_ELEM2 RLC)) -#endif + +#define BOOST_PP_LIST_FIRST_N_C(D,RLC) BOOST_PP_TUPLE_ELEM(3,2,RLC) +#define BOOST_PP_LIST_FIRST_N_F(D,RLC) ((BOOST_PP_TUPLE_ELEM(3,0,BOOST_PP_TUPLE_ELEM(3,1,RLC)),BOOST_PP_TUPLE_ELEM(3,0,RLC),1),BOOST_PP_TUPLE_ELEM(3,1,BOOST_PP_TUPLE_ELEM(3,1,RLC)),BOOST_PP_DEC(BOOST_PP_TUPLE_ELEM(3,2,RLC))) + #endif diff --git a/include/boost/preprocessor/list/for_each_product.hpp b/include/boost/preprocessor/list/for_each_product.hpp index 38ccec4..0e7f692 100644 --- a/include/boost/preprocessor/list/for_each_product.hpp +++ b/include/boost/preprocessor/list/for_each_product.hpp @@ -59,24 +59,15 @@ BOOST_PP_LIST_FOR_EACH_PRODUCT /**Can be used inside BOOST_PP_FOR() (see for an explanation of the R parameter).
*/ #define BOOST_PP_LIST_FOR_EACH_PRODUCT_R(R,MACRO,SIZE_OF_TUPLE,TUPLE_OF_LISTS) BOOST_PP_LIST_FOR_EACH_PRODUCT_R2(0,MACRO,BOOST_PP_TUPLE_TO_LIST(SIZE_OF_TUPLE,BOOST_PP_TUPLE_REVERSE(SIZE_OF_TUPLE,TUPLE_OF_LISTS))) -#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)) -# define BOOST_PP_LIST_FOR_EACH_PRODUCT_F(R,P) (BOOST_PP_LIST_REST(BOOST_PP_TUPLE_ELEM(4,0,P)),BOOST_PP_TUPLE_ELEM(4,1,P),BOOST_PP_TUPLE_ELEM(4,2,P),BOOST_PP_TUPLE_ELEM(4,3,P)) -# define BOOST_PP_LIST_FOR_EACH_PRODUCT_I(R,P) BOOST_PP_TUPLE_ELEM(4,3,P)(R,BOOST_PP_LIST_TO_TUPLE_R(R,(BOOST_PP_TUPLE_ELEM(3,0,BOOST_PP_TUPLE_ELEM(4,0,P)),BOOST_PP_TUPLE_ELEM(4,2,P),1))) -# define BOOST_PP_LIST_FOR_EACH_PRODUCT_I_C(P,I) BOOST_PP_IF(BOOST_PP_TUPLE_ELEM(3,2,BOOST_PP_TUPLE_ELEM(4,1,P)),BOOST_PP_LIST_FOR_EACH_PRODUCT_I##I##_C,BOOST_PP_LIST_FOR_EACH_PRODUCT_I) -# define BOOST_PP_LIST_FOR_EACH_PRODUCT_I_H(P) (BOOST_PP_TUPLE_ELEM(3,0,BOOST_PP_TUPLE_ELEM(4,1,P)),BOOST_PP_TUPLE_ELEM(3,1,BOOST_PP_TUPLE_ELEM(4,1,P)),(BOOST_PP_TUPLE_ELEM(3,0,BOOST_PP_TUPLE_ELEM(4,0,P)),BOOST_PP_TUPLE_ELEM(4,2,P),1),BOOST_PP_TUPLE_ELEM(4,3,P)) -#else -# define BOOST_PP_LIST_FOR_EACH_PRODUCT_R2(R,F,LL) BOOST_PP_FOR##R((BOOST_PP_TUPLE3_ELEM0 LL,BOOST_PP_TUPLE3_ELEM1 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_TUPLE3_ELEM2 BOOST_PP_TUPLE4_ELEM0 P -# define BOOST_PP_LIST_FOR_EACH_PRODUCT_F(R,P) (BOOST_PP_LIST_REST(BOOST_PP_TUPLE4_ELEM0 P),BOOST_PP_TUPLE4_ELEM1 P,BOOST_PP_TUPLE4_ELEM2 P,BOOST_PP_TUPLE4_ELEM3 P) +#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)) +#define BOOST_PP_LIST_FOR_EACH_PRODUCT_F(R,P) (BOOST_PP_LIST_REST(BOOST_PP_TUPLE_ELEM(4,0,P)),BOOST_PP_TUPLE_ELEM(4,1,P),BOOST_PP_TUPLE_ELEM(4,2,P),BOOST_PP_TUPLE_ELEM(4,3,P)) + +#define BOOST_PP_LIST_FOR_EACH_PRODUCT_I(R,P) BOOST_PP_TUPLE_ELEM(4,3,P)(R,BOOST_PP_LIST_TO_TUPLE_R(R,(BOOST_PP_TUPLE_ELEM(3,0,BOOST_PP_TUPLE_ELEM(4,0,P)),BOOST_PP_TUPLE_ELEM(4,2,P),1))) +#define BOOST_PP_LIST_FOR_EACH_PRODUCT_I_C(P,I) BOOST_PP_IF(BOOST_PP_TUPLE_ELEM(3,2,BOOST_PP_TUPLE_ELEM(4,1,P)),BOOST_PP_LIST_FOR_EACH_PRODUCT_I##I##_C,BOOST_PP_LIST_FOR_EACH_PRODUCT_I) +#define BOOST_PP_LIST_FOR_EACH_PRODUCT_I_H(P) (BOOST_PP_TUPLE_ELEM(3,0,BOOST_PP_TUPLE_ELEM(4,1,P)),BOOST_PP_TUPLE_ELEM(3,1,BOOST_PP_TUPLE_ELEM(4,1,P)),(BOOST_PP_TUPLE_ELEM(3,0,BOOST_PP_TUPLE_ELEM(4,0,P)),BOOST_PP_TUPLE_ELEM(4,2,P),1),BOOST_PP_TUPLE_ELEM(4,3,P)) -# define BOOST_PP_LIST_FOR_EACH_PRODUCT_I(R,P) BOOST_PP_TUPLE4_ELEM3 P(R,BOOST_PP_LIST_TO_TUPLE_R(R,(BOOST_PP_TUPLE3_ELEM0 BOOST_PP_TUPLE4_ELEM0 P,BOOST_PP_TUPLE4_ELEM2 P,1))) -# define BOOST_PP_LIST_FOR_EACH_PRODUCT_I_C(P,I) BOOST_PP_IF(BOOST_PP_TUPLE3_ELEM2 BOOST_PP_TUPLE4_ELEM1 P,BOOST_PP_LIST_FOR_EACH_PRODUCT_I##I##_C,BOOST_PP_LIST_FOR_EACH_PRODUCT_I) -# define BOOST_PP_LIST_FOR_EACH_PRODUCT_I_H(P) (BOOST_PP_TUPLE3_ELEM0 BOOST_PP_TUPLE4_ELEM1 P,BOOST_PP_TUPLE3_ELEM1 BOOST_PP_TUPLE4_ELEM1 P,(BOOST_PP_TUPLE3_ELEM0 BOOST_PP_TUPLE4_ELEM0 P,BOOST_PP_TUPLE4_ELEM2 P,1),BOOST_PP_TUPLE4_ELEM3 P) -#endif #define BOOST_PP_LIST_FOR_EACH_PRODUCT_I0_C(R,P) BOOST_PP_FOR##R(BOOST_PP_LIST_FOR_EACH_PRODUCT_I_H(P),BOOST_PP_LIST_FOR_EACH_PRODUCT_C,BOOST_PP_LIST_FOR_EACH_PRODUCT_F,BOOST_PP_LIST_FOR_EACH_PRODUCT_I1) #define BOOST_PP_LIST_FOR_EACH_PRODUCT_I0(R,P) BOOST_PP_LIST_FOR_EACH_PRODUCT_I_C(P,0)(R,P) #define BOOST_PP_LIST_FOR_EACH_PRODUCT_I1_C(R,P) BOOST_PP_FOR##R(BOOST_PP_LIST_FOR_EACH_PRODUCT_I_H(P),BOOST_PP_LIST_FOR_EACH_PRODUCT_C,BOOST_PP_LIST_FOR_EACH_PRODUCT_F,BOOST_PP_LIST_FOR_EACH_PRODUCT_I2) diff --git a/include/boost/preprocessor/list/rest_n.hpp b/include/boost/preprocessor/list/rest_n.hpp index b698dd1..0ee4787 100644 --- a/include/boost/preprocessor/list/rest_n.hpp +++ b/include/boost/preprocessor/list/rest_n.hpp @@ -46,11 +46,7 @@ BOOST_PP_TUPLE_TO_LIST(2,(*,/)) /**Can be used inside BOOST_PP_WHILE() (see for an explanation of the D parameter).
*/ #define BOOST_PP_LIST_REST_N_D(D,COUNT,LIST) BOOST_PP_TUPLE_ELEM(2,0,BOOST_PP_WHILE##D(BOOST_PP_LIST_REST_N_C,BOOST_PP_LIST_REST_N_F,(LIST,COUNT))) -#if !defined(BOOST_NO_COMPILER_CONFIG) && defined(__MWERKS__) -# define BOOST_PP_LIST_REST_N_C(D,LC) BOOST_PP_TUPLE_ELEM(2,1,LC) -# define BOOST_PP_LIST_REST_N_F(D,LC) (BOOST_PP_TUPLE_ELEM(3,1,BOOST_PP_TUPLE_ELEM(2,0,LC)),BOOST_PP_DEC(BOOST_PP_TUPLE_ELEM(2,1,LC))) -#else -# define BOOST_PP_LIST_REST_N_C(D,LC) BOOST_PP_TUPLE2_ELEM1 LC -# define BOOST_PP_LIST_REST_N_F(D,LC) (BOOST_PP_TUPLE3_ELEM1 BOOST_PP_TUPLE2_ELEM0 LC,BOOST_PP_DEC(BOOST_PP_TUPLE2_ELEM1 LC)) -#endif + +#define BOOST_PP_LIST_REST_N_C(D,LC) BOOST_PP_TUPLE_ELEM(2,1,LC) +#define BOOST_PP_LIST_REST_N_F(D,LC) (BOOST_PP_TUPLE_ELEM(3,1,BOOST_PP_TUPLE_ELEM(2,0,LC)),BOOST_PP_DEC(BOOST_PP_TUPLE_ELEM(2,1,LC))) #endif diff --git a/include/boost/preprocessor/list/transform.hpp b/include/boost/preprocessor/list/transform.hpp index 3372bbf..76c9e81 100644 --- a/include/boost/preprocessor/list/transform.hpp +++ b/include/boost/preprocessor/list/transform.hpp @@ -49,11 +49,6 @@ BOOST_PP_TUPLE_TO_LIST(2,(3,4)) /**Can be used inside BOOST_PP_WHILE() (see for an explanation of the D parameter).
*/ #define BOOST_PP_LIST_TRANSFORM_D(D,OP,DATA,LIST) BOOST_PP_TUPLE_ELEM(3,2,BOOST_PP_LIST_FOLD_RIGHT_D(D,BOOST_PP_LIST_TRANSFORM_F,LIST,(OP,DATA,(_,_,0)))) -#if !defined(BOOST_NO_COMPILER_CONFIG) && defined(__MWERKS__) -# define BOOST_PP_LIST_TRANSFORM_F(D,X,ODR) (BOOST_PP_TUPLE_ELEM(3,0,ODR),BOOST_PP_TUPLE_ELEM(3,1,ODR),(BOOST_PP_TUPLE_ELEM(3,0,ODR)(D,BOOST_PP_TUPLE_ELEM(3,1,ODR),X),BOOST_PP_TUPLE_ELEM(3,2,ODR),1)) -#elif !defined(BOOST_NO_COMPILER_CONFIG) && defined(_MSC_VER) -# define BOOST_PP_LIST_TRANSFORM_F(D,X,ODR) (BOOST_PP_TUPLE_ELEM(3,0,ODR),BOOST_PP_TUPLE3_ELEM1 ODR,(BOOST_PP_TUPLE_ELEM(3,0,ODR)(D,BOOST_PP_TUPLE3_ELEM1 ODR,X),BOOST_PP_TUPLE3_ELEM2 ODR,1)) -#else -# define BOOST_PP_LIST_TRANSFORM_F(D,X,ODR) (BOOST_PP_TUPLE3_ELEM0 ODR,BOOST_PP_TUPLE3_ELEM1 ODR,(BOOST_PP_TUPLE3_ELEM0 ODR(D,BOOST_PP_TUPLE3_ELEM1 ODR,X),BOOST_PP_TUPLE3_ELEM2 ODR,1)) -#endif + +#define BOOST_PP_LIST_TRANSFORM_F(D,X,ODR) (BOOST_PP_TUPLE_ELEM(3,0,ODR),BOOST_PP_TUPLE_ELEM(3,1,ODR),(BOOST_PP_TUPLE_ELEM(3,0,ODR)(D,BOOST_PP_TUPLE_ELEM(3,1,ODR),X),BOOST_PP_TUPLE_ELEM(3,2,ODR),1)) #endif diff --git a/include/boost/preprocessor/tuple/elem.hpp b/include/boost/preprocessor/tuple/elem.hpp index 191e096..bcc665f 100644 --- a/include/boost/preprocessor/tuple/elem.hpp +++ b/include/boost/preprocessor/tuple/elem.hpp @@ -13,6 +13,9 @@ * See http://www.boost.org for most recent version. */ +#includeExpands to the INDEX
:th element of an SIZE_OF_TUPLE
-tuple.
For example,
@@ -28,161 +31,24 @@ BOOST_PP_TUPLE_ELEM(2,1,(A,B))