From 8854c2c573a16c57097266a76d039c17b3bb3a55 Mon Sep 17 00:00:00 2001 From: Vesa Karvonen Date: Sun, 16 Jun 2002 08:06:36 +0000 Subject: [PATCH] O(N*N) space and O(1) time BOOST_PP_TUPLE_ELEM() [SVN r14149] --- include/boost/preprocessor/arithmetic/add.hpp | 10 +- include/boost/preprocessor/arithmetic/div.hpp | 10 +- include/boost/preprocessor/arithmetic/mod.hpp | 4 +- include/boost/preprocessor/arithmetic/mul.hpp | 10 +- include/boost/preprocessor/arithmetic/sub.hpp | 10 +- include/boost/preprocessor/detail/expand.hpp | 15 ++ include/boost/preprocessor/enum.hpp | 13 +- .../enum_params_with_a_default.hpp | 6 +- .../enum_params_with_defaults.hpp | 6 +- include/boost/preprocessor/enum_shifted.hpp | 6 +- include/boost/preprocessor/if.hpp | 5 +- include/boost/preprocessor/list/adt.hpp | 24 +-- include/boost/preprocessor/list/cat.hpp | 2 +- include/boost/preprocessor/list/filter.hpp | 9 +- include/boost/preprocessor/list/first_n.hpp | 11 +- .../preprocessor/list/for_each_product.hpp | 23 +-- include/boost/preprocessor/list/rest_n.hpp | 10 +- include/boost/preprocessor/list/transform.hpp | 9 +- include/boost/preprocessor/tuple/elem.hpp | 174 ++---------------- 19 files changed, 81 insertions(+), 276 deletions(-) create mode 100644 include/boost/preprocessor/detail/expand.hpp 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 @@ #include #include -#include /**

Expands to THEN if COND != 0 and ELSE if COND == 0.

@@ -34,5 +33,7 @@
  • preprocessor_test.cpp
  • */ -#define BOOST_PP_IF(COND,THEN,ELSE) BOOST_PP_DETAIL_CAT2(BOOST_PP_TUPLE2_ELEM,BOOST_PP_BOOL(COND))(ELSE,THEN) +#define BOOST_PP_IF(COND,THEN,ELSE) BOOST_PP_DETAIL_CAT2(BOOST_PP_IF,BOOST_PP_BOOL(COND))(ELSE,THEN) +#define BOOST_PP_IF0(E,T) E +#define BOOST_PP_IF1(E,T) T #endif diff --git a/include/boost/preprocessor/list/adt.hpp b/include/boost/preprocessor/list/adt.hpp index 8479104..3800437 100644 --- a/include/boost/preprocessor/list/adt.hpp +++ b/include/boost/preprocessor/list/adt.hpp @@ -71,18 +71,10 @@ BOOST_PP_LIST_FOLD_RIGHT #define BOOST_PP_LIST_NIL (_,_,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. */ +#include +#include + /**

    Expands 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))
  • BOOST_PP_LIMIT_TUPLE
  • */ -#if !defined(BOOST_NO_COMPILER_CONFIG) && defined(__MWERKS__) -# define BOOST_PP_TUPLE_ELEM(SIZE_OF_TUPLE,INDEX,TUPLE) BOOST_PP_TUPLE_ELEM_DELAY(SIZE_OF_TUPLE,INDEX,TUPLE) -/* This is a workaround for a CodeWarrior PP bug. Strictly speaking - * this workaround invokes undefined behavior, but it works as desired. - */ -# define BOOST_PP_TUPLE_ELEM_DELAY(N,I,T) BOOST_PP_TUPLE##N##_ELEM##I##T -#elif !defined(BOOST_NO_COMPILER_CONFIG) && defined(_MSC_VER) -# include -/* This is a workaround for a MSVC++ PP bug. It should not be necessary - * to use BOOST_PP_EXPAND(). Works on standard conforming compilers, too. - */ -# define BOOST_PP_TUPLE_ELEM(SIZE_OF_TUPLE,INDEX,TUPLE) BOOST_PP_EXPAND(BOOST_PP_TUPLE_ELEM_DELAY(SIZE_OF_TUPLE,INDEX)TUPLE) -# define BOOST_PP_TUPLE_ELEM_DELAY(N,I) BOOST_PP_TUPLE##N##_ELEM##I -#else -# define BOOST_PP_TUPLE_ELEM(SIZE_OF_TUPLE,INDEX,TUPLE) BOOST_PP_TUPLE_ELEM_DELAY(SIZE_OF_TUPLE,INDEX)TUPLE -# define BOOST_PP_TUPLE_ELEM_DELAY(N,I) BOOST_PP_TUPLE##N##_ELEM##I -#endif +#define BOOST_PP_TUPLE_ELEM(SIZE_OF_TUPLE,INDEX,TUPLE) BOOST_PP_DETAIL_EXPAND(BOOST_PP_DETAIL_CAT2(BOOST_PP_TUPLE16_ELEM,INDEX) BOOST_PP_DETAIL_CAT2(BOOST_PP_TUPLE_ELEM_EX,SIZE_OF_TUPLE) TUPLE) -/* TUPLE_ELEM can be implemented in O(N*N) space and O(N) time instead - * of O(N*N*N) space and O(1) time. The current trade-off seems better. - */ -#define BOOST_PP_TUPLE1_ELEM0(A) A - -#define BOOST_PP_TUPLE2_ELEM0(A,B) A -#define BOOST_PP_TUPLE2_ELEM1(A,B) B - -#define BOOST_PP_TUPLE3_ELEM0(A,B,C) A -#define BOOST_PP_TUPLE3_ELEM1(A,B,C) B -#define BOOST_PP_TUPLE3_ELEM2(A,B,C) C - -#define BOOST_PP_TUPLE4_ELEM0(A,B,C,D) A -#define BOOST_PP_TUPLE4_ELEM1(A,B,C,D) B -#define BOOST_PP_TUPLE4_ELEM2(A,B,C,D) C -#define BOOST_PP_TUPLE4_ELEM3(A,B,C,D) D - -#define BOOST_PP_TUPLE5_ELEM0(A,B,C,D,E) A -#define BOOST_PP_TUPLE5_ELEM1(A,B,C,D,E) B -#define BOOST_PP_TUPLE5_ELEM2(A,B,C,D,E) C -#define BOOST_PP_TUPLE5_ELEM3(A,B,C,D,E) D -#define BOOST_PP_TUPLE5_ELEM4(A,B,C,D,E) E - -#define BOOST_PP_TUPLE6_ELEM0(A,B,C,D,E,F) A -#define BOOST_PP_TUPLE6_ELEM1(A,B,C,D,E,F) B -#define BOOST_PP_TUPLE6_ELEM2(A,B,C,D,E,F) C -#define BOOST_PP_TUPLE6_ELEM3(A,B,C,D,E,F) D -#define BOOST_PP_TUPLE6_ELEM4(A,B,C,D,E,F) E -#define BOOST_PP_TUPLE6_ELEM5(A,B,C,D,E,F) F - -#define BOOST_PP_TUPLE7_ELEM0(A,B,C,D,E,F,G) A -#define BOOST_PP_TUPLE7_ELEM1(A,B,C,D,E,F,G) B -#define BOOST_PP_TUPLE7_ELEM2(A,B,C,D,E,F,G) C -#define BOOST_PP_TUPLE7_ELEM3(A,B,C,D,E,F,G) D -#define BOOST_PP_TUPLE7_ELEM4(A,B,C,D,E,F,G) E -#define BOOST_PP_TUPLE7_ELEM5(A,B,C,D,E,F,G) F -#define BOOST_PP_TUPLE7_ELEM6(A,B,C,D,E,F,G) G - -#define BOOST_PP_TUPLE8_ELEM0(A,B,C,D,E,F,G,H) A -#define BOOST_PP_TUPLE8_ELEM1(A,B,C,D,E,F,G,H) B -#define BOOST_PP_TUPLE8_ELEM2(A,B,C,D,E,F,G,H) C -#define BOOST_PP_TUPLE8_ELEM3(A,B,C,D,E,F,G,H) D -#define BOOST_PP_TUPLE8_ELEM4(A,B,C,D,E,F,G,H) E -#define BOOST_PP_TUPLE8_ELEM5(A,B,C,D,E,F,G,H) F -#define BOOST_PP_TUPLE8_ELEM6(A,B,C,D,E,F,G,H) G -#define BOOST_PP_TUPLE8_ELEM7(A,B,C,D,E,F,G,H) H - -#define BOOST_PP_TUPLE9_ELEM0(A,B,C,D,E,F,G,H,I) A -#define BOOST_PP_TUPLE9_ELEM1(A,B,C,D,E,F,G,H,I) B -#define BOOST_PP_TUPLE9_ELEM2(A,B,C,D,E,F,G,H,I) C -#define BOOST_PP_TUPLE9_ELEM3(A,B,C,D,E,F,G,H,I) D -#define BOOST_PP_TUPLE9_ELEM4(A,B,C,D,E,F,G,H,I) E -#define BOOST_PP_TUPLE9_ELEM5(A,B,C,D,E,F,G,H,I) F -#define BOOST_PP_TUPLE9_ELEM6(A,B,C,D,E,F,G,H,I) G -#define BOOST_PP_TUPLE9_ELEM7(A,B,C,D,E,F,G,H,I) H -#define BOOST_PP_TUPLE9_ELEM8(A,B,C,D,E,F,G,H,I) I - -#define BOOST_PP_TUPLE10_ELEM0(A,B,C,D,E,F,G,H,I,J) A -#define BOOST_PP_TUPLE10_ELEM1(A,B,C,D,E,F,G,H,I,J) B -#define BOOST_PP_TUPLE10_ELEM2(A,B,C,D,E,F,G,H,I,J) C -#define BOOST_PP_TUPLE10_ELEM3(A,B,C,D,E,F,G,H,I,J) D -#define BOOST_PP_TUPLE10_ELEM4(A,B,C,D,E,F,G,H,I,J) E -#define BOOST_PP_TUPLE10_ELEM5(A,B,C,D,E,F,G,H,I,J) F -#define BOOST_PP_TUPLE10_ELEM6(A,B,C,D,E,F,G,H,I,J) G -#define BOOST_PP_TUPLE10_ELEM7(A,B,C,D,E,F,G,H,I,J) H -#define BOOST_PP_TUPLE10_ELEM8(A,B,C,D,E,F,G,H,I,J) I -#define BOOST_PP_TUPLE10_ELEM9(A,B,C,D,E,F,G,H,I,J) J - -#define BOOST_PP_TUPLE11_ELEM0(A,B,C,D,E,F,G,H,I,J,K) A -#define BOOST_PP_TUPLE11_ELEM1(A,B,C,D,E,F,G,H,I,J,K) B -#define BOOST_PP_TUPLE11_ELEM2(A,B,C,D,E,F,G,H,I,J,K) C -#define BOOST_PP_TUPLE11_ELEM3(A,B,C,D,E,F,G,H,I,J,K) D -#define BOOST_PP_TUPLE11_ELEM4(A,B,C,D,E,F,G,H,I,J,K) E -#define BOOST_PP_TUPLE11_ELEM5(A,B,C,D,E,F,G,H,I,J,K) F -#define BOOST_PP_TUPLE11_ELEM6(A,B,C,D,E,F,G,H,I,J,K) G -#define BOOST_PP_TUPLE11_ELEM7(A,B,C,D,E,F,G,H,I,J,K) H -#define BOOST_PP_TUPLE11_ELEM8(A,B,C,D,E,F,G,H,I,J,K) I -#define BOOST_PP_TUPLE11_ELEM9(A,B,C,D,E,F,G,H,I,J,K) J -#define BOOST_PP_TUPLE11_ELEM10(A,B,C,D,E,F,G,H,I,J,K) K - -#define BOOST_PP_TUPLE12_ELEM0(A,B,C,D,E,F,G,H,I,J,K,L) A -#define BOOST_PP_TUPLE12_ELEM1(A,B,C,D,E,F,G,H,I,J,K,L) B -#define BOOST_PP_TUPLE12_ELEM2(A,B,C,D,E,F,G,H,I,J,K,L) C -#define BOOST_PP_TUPLE12_ELEM3(A,B,C,D,E,F,G,H,I,J,K,L) D -#define BOOST_PP_TUPLE12_ELEM4(A,B,C,D,E,F,G,H,I,J,K,L) E -#define BOOST_PP_TUPLE12_ELEM5(A,B,C,D,E,F,G,H,I,J,K,L) F -#define BOOST_PP_TUPLE12_ELEM6(A,B,C,D,E,F,G,H,I,J,K,L) G -#define BOOST_PP_TUPLE12_ELEM7(A,B,C,D,E,F,G,H,I,J,K,L) H -#define BOOST_PP_TUPLE12_ELEM8(A,B,C,D,E,F,G,H,I,J,K,L) I -#define BOOST_PP_TUPLE12_ELEM9(A,B,C,D,E,F,G,H,I,J,K,L) J -#define BOOST_PP_TUPLE12_ELEM10(A,B,C,D,E,F,G,H,I,J,K,L) K -#define BOOST_PP_TUPLE12_ELEM11(A,B,C,D,E,F,G,H,I,J,K,L) L - -#define BOOST_PP_TUPLE13_ELEM0(A,B,C,D,E,F,G,H,I,J,K,L,M) A -#define BOOST_PP_TUPLE13_ELEM1(A,B,C,D,E,F,G,H,I,J,K,L,M) B -#define BOOST_PP_TUPLE13_ELEM2(A,B,C,D,E,F,G,H,I,J,K,L,M) C -#define BOOST_PP_TUPLE13_ELEM3(A,B,C,D,E,F,G,H,I,J,K,L,M) D -#define BOOST_PP_TUPLE13_ELEM4(A,B,C,D,E,F,G,H,I,J,K,L,M) E -#define BOOST_PP_TUPLE13_ELEM5(A,B,C,D,E,F,G,H,I,J,K,L,M) F -#define BOOST_PP_TUPLE13_ELEM6(A,B,C,D,E,F,G,H,I,J,K,L,M) G -#define BOOST_PP_TUPLE13_ELEM7(A,B,C,D,E,F,G,H,I,J,K,L,M) H -#define BOOST_PP_TUPLE13_ELEM8(A,B,C,D,E,F,G,H,I,J,K,L,M) I -#define BOOST_PP_TUPLE13_ELEM9(A,B,C,D,E,F,G,H,I,J,K,L,M) J -#define BOOST_PP_TUPLE13_ELEM10(A,B,C,D,E,F,G,H,I,J,K,L,M) K -#define BOOST_PP_TUPLE13_ELEM11(A,B,C,D,E,F,G,H,I,J,K,L,M) L -#define BOOST_PP_TUPLE13_ELEM12(A,B,C,D,E,F,G,H,I,J,K,L,M) M - -#define BOOST_PP_TUPLE14_ELEM0(A,B,C,D,E,F,G,H,I,J,K,L,M,N) A -#define BOOST_PP_TUPLE14_ELEM1(A,B,C,D,E,F,G,H,I,J,K,L,M,N) B -#define BOOST_PP_TUPLE14_ELEM2(A,B,C,D,E,F,G,H,I,J,K,L,M,N) C -#define BOOST_PP_TUPLE14_ELEM3(A,B,C,D,E,F,G,H,I,J,K,L,M,N) D -#define BOOST_PP_TUPLE14_ELEM4(A,B,C,D,E,F,G,H,I,J,K,L,M,N) E -#define BOOST_PP_TUPLE14_ELEM5(A,B,C,D,E,F,G,H,I,J,K,L,M,N) F -#define BOOST_PP_TUPLE14_ELEM6(A,B,C,D,E,F,G,H,I,J,K,L,M,N) G -#define BOOST_PP_TUPLE14_ELEM7(A,B,C,D,E,F,G,H,I,J,K,L,M,N) H -#define BOOST_PP_TUPLE14_ELEM8(A,B,C,D,E,F,G,H,I,J,K,L,M,N) I -#define BOOST_PP_TUPLE14_ELEM9(A,B,C,D,E,F,G,H,I,J,K,L,M,N) J -#define BOOST_PP_TUPLE14_ELEM10(A,B,C,D,E,F,G,H,I,J,K,L,M,N) K -#define BOOST_PP_TUPLE14_ELEM11(A,B,C,D,E,F,G,H,I,J,K,L,M,N) L -#define BOOST_PP_TUPLE14_ELEM12(A,B,C,D,E,F,G,H,I,J,K,L,M,N) M -#define BOOST_PP_TUPLE14_ELEM13(A,B,C,D,E,F,G,H,I,J,K,L,M,N) N - -#define BOOST_PP_TUPLE15_ELEM0(A,B,C,D,E,F,G,H,I,J,K,L,M,N,O) A -#define BOOST_PP_TUPLE15_ELEM1(A,B,C,D,E,F,G,H,I,J,K,L,M,N,O) B -#define BOOST_PP_TUPLE15_ELEM2(A,B,C,D,E,F,G,H,I,J,K,L,M,N,O) C -#define BOOST_PP_TUPLE15_ELEM3(A,B,C,D,E,F,G,H,I,J,K,L,M,N,O) D -#define BOOST_PP_TUPLE15_ELEM4(A,B,C,D,E,F,G,H,I,J,K,L,M,N,O) E -#define BOOST_PP_TUPLE15_ELEM5(A,B,C,D,E,F,G,H,I,J,K,L,M,N,O) F -#define BOOST_PP_TUPLE15_ELEM6(A,B,C,D,E,F,G,H,I,J,K,L,M,N,O) G -#define BOOST_PP_TUPLE15_ELEM7(A,B,C,D,E,F,G,H,I,J,K,L,M,N,O) H -#define BOOST_PP_TUPLE15_ELEM8(A,B,C,D,E,F,G,H,I,J,K,L,M,N,O) I -#define BOOST_PP_TUPLE15_ELEM9(A,B,C,D,E,F,G,H,I,J,K,L,M,N,O) J -#define BOOST_PP_TUPLE15_ELEM10(A,B,C,D,E,F,G,H,I,J,K,L,M,N,O) K -#define BOOST_PP_TUPLE15_ELEM11(A,B,C,D,E,F,G,H,I,J,K,L,M,N,O) L -#define BOOST_PP_TUPLE15_ELEM12(A,B,C,D,E,F,G,H,I,J,K,L,M,N,O) M -#define BOOST_PP_TUPLE15_ELEM13(A,B,C,D,E,F,G,H,I,J,K,L,M,N,O) N -#define BOOST_PP_TUPLE15_ELEM14(A,B,C,D,E,F,G,H,I,J,K,L,M,N,O) O +#define BOOST_PP_TUPLE_ELEM_EX1(A) (A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P) +#define BOOST_PP_TUPLE_ELEM_EX2(A,B) (A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P) +#define BOOST_PP_TUPLE_ELEM_EX3(A,B,C) (A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P) +#define BOOST_PP_TUPLE_ELEM_EX4(A,B,C,D) (A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P) +#define BOOST_PP_TUPLE_ELEM_EX5(A,B,C,D,E) (A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P) +#define BOOST_PP_TUPLE_ELEM_EX6(A,B,C,D,E,F) (A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P) +#define BOOST_PP_TUPLE_ELEM_EX7(A,B,C,D,E,F,G) (A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P) +#define BOOST_PP_TUPLE_ELEM_EX8(A,B,C,D,E,F,G,H) (A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P) +#define BOOST_PP_TUPLE_ELEM_EX9(A,B,C,D,E,F,G,H,I) (A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P) +#define BOOST_PP_TUPLE_ELEM_EX10(A,B,C,D,E,F,G,H,I,J) (A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P) +#define BOOST_PP_TUPLE_ELEM_EX11(A,B,C,D,E,F,G,H,I,J,K) (A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P) +#define BOOST_PP_TUPLE_ELEM_EX12(A,B,C,D,E,F,G,H,I,J,K,L) (A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P) +#define BOOST_PP_TUPLE_ELEM_EX13(A,B,C,D,E,F,G,H,I,J,K,L,M) (A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P) +#define BOOST_PP_TUPLE_ELEM_EX14(A,B,C,D,E,F,G,H,I,J,K,L,M,N) (A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P) +#define BOOST_PP_TUPLE_ELEM_EX15(A,B,C,D,E,F,G,H,I,J,K,L,M,N,O) (A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P) +#define BOOST_PP_TUPLE_ELEM_EX16(A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P) (A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P) #define BOOST_PP_TUPLE16_ELEM0(A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P) A #define BOOST_PP_TUPLE16_ELEM1(A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P) B