diff --git a/doc/reference/assert_msg.htm b/doc/reference/assert_msg.htm index d5d1734..872a46e 100644 --- a/doc/reference/assert_msg.htm +++ b/doc/reference/assert_msg.htm @@ -26,9 +26,11 @@
-

#define BOOST_PP_ASSERT_MSG(C,MSG)

-

Expands to nothing if C != 0 and to MSG if -C == 0.

+

#define BOOST_PP_ASSERT_MSG(COND,MSG)

+

Expands to nothing if COND != 0 and to MSG if +COND == 0.

+ +

COND must expand to an integer literal.

For example, BOOST_PP_ASSERT_MSG(1,A BUG!) expands to A BUG!.

diff --git a/doc/reference/comma_if.htm b/doc/reference/comma_if.htm index 06d37ad..d97b47a 100644 --- a/doc/reference/comma_if.htm +++ b/doc/reference/comma_if.htm @@ -26,9 +26,11 @@
-

#define BOOST_PP_COMMA_IF(C)

-

Expands to a comma if C != 0 and nothing if -C == 0.

+

#define BOOST_PP_COMMA_IF(COND)

+

Expands to a comma if COND != 0 and nothing if +COND == 0.

+ +

COND must expand to an integer literal.

For example, BOOST_PP_COMMA_IF(0) expands to nothing.

diff --git a/doc/reference/comparison_equal.htm b/doc/reference/comparison_equal.htm index 6a9d8f3..f2b0b89 100644 --- a/doc/reference/comparison_equal.htm +++ b/doc/reference/comparison_equal.htm @@ -30,6 +30,8 @@

Expands to 1 if X == Y and 0 otherwise.

+

Both X and Y must expand to integer literals.

+

For example, BOOST_PP_EQUAL(4,4) expands to 1.

Uses

diff --git a/doc/reference/comparison_greater.htm b/doc/reference/comparison_greater.htm index 1e7cd14..ddbf679 100644 --- a/doc/reference/comparison_greater.htm +++ b/doc/reference/comparison_greater.htm @@ -30,6 +30,8 @@

Expands to 1 if X > Y and 0 otherwise.

+

Both X and Y must expand to integer literals.

+

For example, BOOST_PP_GREATER(4,3) expands to 1.

Uses

diff --git a/doc/reference/comparison_greater_equal.htm b/doc/reference/comparison_greater_equal.htm index 476d771..96f8f74 100644 --- a/doc/reference/comparison_greater_equal.htm +++ b/doc/reference/comparison_greater_equal.htm @@ -30,6 +30,8 @@

Expands to 1 if X >= Y and 0 otherwise.

+

Both X and Y must expand to integer literals.

+

For example, BOOST_PP_GREATER_EQUAL(1,3) expands to 0.

Uses

diff --git a/doc/reference/comparison_less.htm b/doc/reference/comparison_less.htm index 62bef5c..be8874e 100644 --- a/doc/reference/comparison_less.htm +++ b/doc/reference/comparison_less.htm @@ -30,6 +30,8 @@

Expands to 1 if X < Y and 0 otherwise.

+

Both X and Y must expand to integer literals.

+

For example, BOOST_PP_LESS(2,6) expands to 1.

Uses

diff --git a/doc/reference/comparison_less_equal.htm b/doc/reference/comparison_less_equal.htm index f4ad193..7da486e 100644 --- a/doc/reference/comparison_less_equal.htm +++ b/doc/reference/comparison_less_equal.htm @@ -30,6 +30,8 @@

Expands to 1 if X <= Y and 0 otherwise.

+

X must expand to an integer literal.

+

For example, BOOST_PP_LESS_EQUAL(7,5) expands to 0.

Uses

diff --git a/doc/reference/comparison_not_equal.htm b/doc/reference/comparison_not_equal.htm index edfe7dd..f579d5b 100644 --- a/doc/reference/comparison_not_equal.htm +++ b/doc/reference/comparison_not_equal.htm @@ -30,6 +30,8 @@

Expands to 1 if X != Y and 0 otherwise.

+

Both X and Y must expand to integer literals.

+

For example, BOOST_PP_NOT_EQUAL(4,4) expands to 0.

Uses

diff --git a/doc/reference/enum.htm b/doc/reference/enum.htm index f037990..e42f2ad 100644 --- a/doc/reference/enum.htm +++ b/doc/reference/enum.htm @@ -26,20 +26,20 @@
-

#define BOOST_PP_ENUM(N,F,P)

+

#define BOOST_PP_ENUM(COUNT,MACRO,DATA)

Generates a comma separated list.

In other words, expands to the sequence:

-  F(0,P), F(1,P), ..., F(BOOST_PP_DEC(N),P)
+  MACRO(0,DATA), MACRO(1,DATA), ..., MACRO(BOOST_PP_DEC(COUNT),DATA)
 

For example,

-  #define TYPED_PARAM(I,P)\
-    BOOST_PP_CAT(BOOST_PP_TUPLE_ELEM(2,0,P),I) BOOST_PP_CAT(BOOST_PP_TUPLE_ELEM(2,1,P),I)
+  #define TYPED_PARAM(INDEX,DATA)\
+    BOOST_PP_CAT(BOOST_PP_TUPLE_ELEM(2,0,DATA),INDEX) BOOST_PP_CAT(BOOST_PP_TUPLE_ELEM(2,1,DATA),INDEX)
   BOOST_PP_ENUM(3,TYPED_PARAM,(X,x))
 
diff --git a/doc/reference/enum_params.htm b/doc/reference/enum_params.htm index 9f4b9a6..08cb30b 100644 --- a/doc/reference/enum_params.htm +++ b/doc/reference/enum_params.htm @@ -26,13 +26,13 @@
-

#define BOOST_PP_ENUM_PARAMS(N,P)

+

#define BOOST_PP_ENUM_PARAMS(COUNT,PARAM)

Generates a comma separated list of parameters.

In other words, expands to the sequence:

-  BOOST_PP_CAT(P,0), BOOST_PP_CAT(P,1), ..., BOOST_PP_CAT(P,BOOST_PP_DEC(N))
+  BOOST_PP_CAT(PARAM,0), BOOST_PP_CAT(PARAM,1), ..., BOOST_PP_CAT(PARAM,BOOST_PP_DEC(COUNT))
 

For example,

diff --git a/doc/reference/enum_params_with_a_default.htm b/doc/reference/enum_params_with_a_default.htm index bd7732e..2307493 100644 --- a/doc/reference/enum_params_with_a_default.htm +++ b/doc/reference/enum_params_with_a_default.htm @@ -26,13 +26,16 @@
-

#define BOOST_PP_ENUM_PARAMS_WITH_A_DEFAULT(N,P,D)

+

#define BOOST_PP_ENUM_PARAMS_WITH_A_DEFAULT(COUNT,PARAM,DEFAULT)

Generates a comma separated list of parameters with a default.

In other words, expands to the sequence:

-  BOOST_PP_CAT(P,0) = D, BOOST_PP_CAT(P,1) = D, ..., BOOST_PP_CAT(P,BOOST_PP_DEC(N)) = D
+  BOOST_PP_CAT(PARAM,0) = DEFAULT,
+  BOOST_PP_CAT(PARAM,1) = DEFAULT,
+  ...,
+  BOOST_PP_CAT(PARAM,BOOST_PP_DEC(COUNT)) = DEFAULT
 

For example,

diff --git a/doc/reference/enum_params_with_defaults.htm b/doc/reference/enum_params_with_defaults.htm index 2e4443a..7cae0ab 100644 --- a/doc/reference/enum_params_with_defaults.htm +++ b/doc/reference/enum_params_with_defaults.htm @@ -26,16 +26,16 @@
-

#define BOOST_PP_ENUM_PARAMS_WITH_DEFAULTS(N,P,D)

+

#define BOOST_PP_ENUM_PARAMS_WITH_DEFAULTS(COUNT,PARAM,DEFAULT)

Generates a comma separated list of parameters with defaults.

In other words, expands to the sequence:

-  BOOST_PP_CAT(P,0) = BOOST_PP_CAT(D,0),
-  BOOST_PP_CAT(P,1) = BOOST_PP_CAT(D,1),
+  BOOST_PP_CAT(PARAM,0) = BOOST_PP_CAT(DEFAULT,0),
+  BOOST_PP_CAT(PARAM,1) = BOOST_PP_CAT(DEFAULT,1),
   ...,
-  BOOST_PP_CAT(P,BOOST_PP_DEC(N)) = BOOST_PP_CAT(D,BOOST_PP_DEC(N))
+  BOOST_PP_CAT(PARAM,BOOST_PP_DEC(COUNT)) = BOOST_PP_CAT(DEFAULT,BOOST_PP_DEC(COUNT))
 

For example,

diff --git a/doc/reference/enum_shifted.htm b/doc/reference/enum_shifted.htm index 5a7901a..e88d1e7 100644 --- a/doc/reference/enum_shifted.htm +++ b/doc/reference/enum_shifted.htm @@ -26,20 +26,20 @@
-

#define BOOST_PP_ENUM_SHIFTED(N,F,P)

+

#define BOOST_PP_ENUM_SHIFTED(COUNT,MACRO,DATA)

Generates a comma separated shifted list.

In other words, expands to the sequence:

-  F(1,P), F(2,P), ..., F(BOOST_PP_DEC(N),P)
+  MACRO(1,DATA), MACRO(2,DATA), ..., MACRO(BOOST_PP_DEC(COUNT),DATA)
 

For example,

-  #define TYPED_PARAM(I,P)\
-    BOOST_PP_CAT(BOOST_PP_TUPLE_ELEM(2,0,P),I) BOOST_PP_CAT(BOOST_PP_TUPLE_ELEM(2,1,P),I)
+  #define TYPED_PARAM(INDEX,DATA)\
+    BOOST_PP_CAT(BOOST_PP_TUPLE_ELEM(2,0,DATA),INDEX) BOOST_PP_CAT(BOOST_PP_TUPLE_ELEM(2,1,DATA),INDEX)
   BOOST_PP_ENUM_SHIFTED(3,TYPED_PARAM,(X,x))
 
diff --git a/doc/reference/enum_shifted_params.htm b/doc/reference/enum_shifted_params.htm index d1c53df..cd6cdec 100644 --- a/doc/reference/enum_shifted_params.htm +++ b/doc/reference/enum_shifted_params.htm @@ -26,13 +26,13 @@
-

#define BOOST_PP_ENUM_SHIFTED_PARAMS(N,P)

+

#define BOOST_PP_ENUM_SHIFTED_PARAMS(COUNT,PARAM)

Generates a comma separated list of shifted actual parameters.

In other words, expands to the sequence:

-  BOOST_PP_CAT(P,1), BOOST_PP_CAT(P,2), ..., BOOST_PP_CAT(P,BOOST_PP_DEC(N))
+  BOOST_PP_CAT(PARAM,1), BOOST_PP_CAT(PARAM,2), ..., BOOST_PP_CAT(PARAM,BOOST_PP_DEC(COUNT))
 

For example,

diff --git a/doc/reference/expr_if.htm b/doc/reference/expr_if.htm index b87c9b4..2b0ca38 100644 --- a/doc/reference/expr_if.htm +++ b/doc/reference/expr_if.htm @@ -26,8 +26,10 @@
-

#define BOOST_PP_EXPR_IF(C,E)

-

Expands to E if C != 0 and to nothing if C == 0.

+

#define BOOST_PP_EXPR_IF(COND,EXPR)

+

Expands to EXPR if COND != 0 and to nothing if COND == 0.

+ +

COND must expand to an integer literal.

For example, BOOST_PP_EXPR_IF(1,^) expands to ^.

diff --git a/doc/reference/for.htm b/doc/reference/for.htm index cc5da2a..4fd15c8 100644 --- a/doc/reference/for.htm +++ b/doc/reference/for.htm @@ -26,25 +26,25 @@
-

#define BOOST_PP_FOR(X,C,F,I)

-

Repeats I(R,X) and iterates F(R,X) while -C(R,X) is true.

+

#define BOOST_PP_FOR(STATE,PRED,OP,MACRO)

+

Repeats MACRO(R,STATE) and iterates OP(R,STATE) while +PRED(R,STATE) is true.

In other words, expands to the sequence:

-  I(R,X)  I(R,F(R,X))  I(R,F(R,F(R,X)))  ...  I(R,F(R,F(...F(R,X)...)))
+  MACRO(R,STATE)  MACRO(R,OP(R,STATE))  MACRO(R,OP(R,OP(R,STATE)))  ...  MACRO(R,OP(R,OP(...OP(R,STATE)...)))
 
-

The length of the sequence is determined by C(R,X).

+

The length of the sequence is determined by PRED(R,STATE).

For example,

-  #define C(R,X) BOOST_PP_LESS(BOOST_PP_TUPLE_ELEM(2,0,X),BOOST_PP_TUPLE_ELEM(2,1,X))
-  #define F(R,X) (BOOST_PP_INC(BOOST_PP_TUPLE_ELEM(2,0,X)),BOOST_PP_TUPLE_ELEM(2,1,X))
-  #define I(R,X) BOOST_PP_TUPLE_ELEM(2,0,X)
-  BOOST_PP_FOR((0,3),C,F,I)
+  #define PRED(R,STATE) BOOST_PP_LESS(BOOST_PP_TUPLE_ELEM(2,0,STATE),BOOST_PP_TUPLE_ELEM(2,1,STATE))
+  #define OP(R,STATE) (BOOST_PP_INC(BOOST_PP_TUPLE_ELEM(2,0,STATE)),BOOST_PP_TUPLE_ELEM(2,1,STATE))
+  #define MACRO(R,STATE) BOOST_PP_TUPLE_ELEM(2,0,STATE)
+  BOOST_PP_FOR((0,3),PRED,OP,MACRO)
 

expands to:

@@ -55,19 +55,19 @@

Legend

BOOST_PP_REPEAT() vs BOOST_PP_FOR()

diff --git a/doc/reference/if.htm b/doc/reference/if.htm index 51fda0d..0f405a2 100644 --- a/doc/reference/if.htm +++ b/doc/reference/if.htm @@ -26,9 +26,11 @@
-

#define BOOST_PP_IF(C,T,E)

-

Expands to T if C != 0 and E if -C == 0.

+

#define BOOST_PP_IF(COND,THEN,ELSE)

+

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

+ +

COND must expand to an integer literal.

For example, BOOST_PP_IF(0,1,2) expands to 2.

diff --git a/doc/reference/limits.htm b/doc/reference/limits.htm index 46b3e51..1979dbe 100644 --- a/doc/reference/limits.htm +++ b/doc/reference/limits.htm @@ -55,7 +55,7 @@ and BOOST_PP_REPEAT family).


#define BOOST_PP_LIMIT_TUPLE

-

Expands to the maximum tuple length supported by the library.

+

Expands to the maximum tuple size supported by the library.


#define BOOST_PREPROCESSOR_LIMIT_DIM

diff --git a/doc/reference/list_adt.htm b/doc/reference/list_adt.htm index 2fbe5d6..3371d35 100644 --- a/doc/reference/list_adt.htm +++ b/doc/reference/list_adt.htm @@ -34,7 +34,7 @@
-

#define BOOST_PP_LIST_CONS(H,T)

+

#define BOOST_PP_LIST_CONS(FIRST,REST)

List constructor.

Lists are build using list constructors BOOST_PP_LIST_NIL and @@ -79,15 +79,15 @@ and BOOST_PP_LIST

List nil constructor.


-

#define BOOST_PP_LIST_IS_CONS(L)

+

#define BOOST_PP_LIST_IS_CONS(LIST)

Expands to 1 if the list is not nil and 0 otherwise.


-

#define BOOST_PP_LIST_IS_NIL(L)

+

#define BOOST_PP_LIST_IS_NIL(LIST)

Expands to 1 if the list is nil and 0 otherwise.


-

#define BOOST_PP_LIST_FIRST(L)

+

#define BOOST_PP_LIST_FIRST(LIST)

Expands to the first element of the list. The list must not be nil.

For example,

@@ -100,7 +100,7 @@ and BOOST_PP_LIST
-

#define BOOST_PP_LIST_REST(L)

+

#define BOOST_PP_LIST_REST(LIST)

Expands to a list of all but the first element of the list.

The list must not be nil.

diff --git a/doc/reference/list_append.htm b/doc/reference/list_append.htm index 2539f82..43c1388 100644 --- a/doc/reference/list_append.htm +++ b/doc/reference/list_append.htm @@ -26,7 +26,7 @@
-

#define BOOST_PP_LIST_APPEND(L,R)

+

#define BOOST_PP_LIST_APPEND(LIST_1ST,LIST_2ND)

Catenates two lists together.

For example,

@@ -56,7 +56,7 @@
-

#define BOOST_PP_LIST_APPEND_D(D,L,R)

+

#define BOOST_PP_LIST_APPEND_D(D,LIST_1ST,LIST_2ND)

Can be used inside BOOST_PP_WHILE().


diff --git a/doc/reference/list_at.htm b/doc/reference/list_at.htm index d15a3bb..86656f0 100644 --- a/doc/reference/list_at.htm +++ b/doc/reference/list_at.htm @@ -26,8 +26,8 @@
-

#define BOOST_PP_LIST_AT(L,I)

-

Expands to the I:th element of the list L. The +

#define BOOST_PP_LIST_AT(LIST,INDEX)

+

Expands to the INDEX:th element of the list LIST. The first element is at index 0.

For example,

@@ -50,7 +50,7 @@ first element is at index 0.


-

#define BOOST_PP_LIST_AT_D(D,L,I)

+

#define BOOST_PP_LIST_AT_D(D,LIST,INDEX)

Can be used inside BOOST_PP_WHILE().


diff --git a/doc/reference/list_cat.htm b/doc/reference/list_cat.htm index 51f3192..b081bab 100644 --- a/doc/reference/list_cat.htm +++ b/doc/reference/list_cat.htm @@ -26,7 +26,7 @@
-

#define BOOST_PP_LIST_CAT(L)

+

#define BOOST_PP_LIST_CAT(LIST)

Catenates all elements of the list.

For example,

@@ -53,7 +53,7 @@
-

#define BOOST_PP_LIST_CAT_D(D,L)

+

#define BOOST_PP_LIST_CAT_D(D,LIST)

Can be used inside BOOST_PP_WHILE().


diff --git a/doc/reference/list_enum.htm b/doc/reference/list_enum.htm index 8b8218c..4b29c7c 100644 --- a/doc/reference/list_enum.htm +++ b/doc/reference/list_enum.htm @@ -26,7 +26,7 @@
-

#define BOOST_PP_LIST_ENUM(L)

+

#define BOOST_PP_LIST_ENUM(LIST)

Converts the list to a comma separated list.

For example,

@@ -48,7 +48,7 @@
-

#define BOOST_PP_LIST_ENUM_R(R,L)

+

#define BOOST_PP_LIST_ENUM_R(R,LIST)

Can be used inside BOOST_PP_FOR().


diff --git a/doc/reference/list_filter.htm b/doc/reference/list_filter.htm index 0672749..0af8614 100644 --- a/doc/reference/list_filter.htm +++ b/doc/reference/list_filter.htm @@ -26,9 +26,9 @@
-

#define BOOST_PP_LIST_FILTER(F,P,L)

+

#define BOOST_PP_LIST_FILTER(PRED,DATA,LIST)

Expands to a list containing all the elements X of the list -for which F(D,P,X) is true.

+for which PRED(D,DATA,X) is true.

For example,

@@ -55,7 +55,7 @@ for which F(D,P,X) is true.


-

#define BOOST_PP_LIST_FILTER_D(D,F,P,L)

+

#define BOOST_PP_LIST_FILTER_D(D,PRED,DATA,LIST)

Can be used inside BOOST_PP_WHILE().


diff --git a/doc/reference/list_first_n.htm b/doc/reference/list_first_n.htm index b083881..31d9988 100644 --- a/doc/reference/list_first_n.htm +++ b/doc/reference/list_first_n.htm @@ -26,9 +26,9 @@
-

#define BOOST_PP_LIST_FIRST_N(N,L)

-

Expands to a list of the first N elements of the list -L.

+

#define BOOST_PP_LIST_FIRST_N(COUNT,LIST)

+

Expands to a list of the first COUNT elements of the list +LIST.

For example,

@@ -59,7 +59,7 @@
-

#define BOOST_PP_LIST_FIRST_N_D(D,N,L)

+

#define BOOST_PP_LIST_FIRST_N_D(D,COUNT,LIST)

Can be used inside BOOST_PP_WHILE().


diff --git a/doc/reference/list_fold_left.htm b/doc/reference/list_fold_left.htm index ca987de..e9e65ce 100644 --- a/doc/reference/list_fold_left.htm +++ b/doc/reference/list_fold_left.htm @@ -26,24 +26,24 @@
-

#define BOOST_PP_LIST_FOLD_LEFT(F,P,L)

-

Iterates F(D,P,X) for each element X of the -list L (from the left or the start of the list).

+

#define BOOST_PP_LIST_FOLD_LEFT(OP,STATE,LIST)

+

Iterates OP(D,STATE,X) for each element X of the +list LIST (from the left or the start of the list).

In other words, expands to:

-  F
+  OP
   ( 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))
+  , ... OP(D, OP(D,STATE,BOOST_PP_LIST_AT(LIST,0)), BOOST_PP_LIST_AT(LIST,1)) ...
+  , BOOST_PP_LIST_AT(LIST,BOOST_PP_DEC(BOOST_PP_LIST_SIZE(LIST))
   )
 

For example,

-  #define TEST(D,P,X) BOOST_PP_CAT(P,X)
+  #define TEST(D,STATE,X) BOOST_PP_CAT(STATE,X)
   BOOST_PP_LIST_FOLD_LEFT(TEST,_,BOOST_PP_TUPLE_TO_LIST(3,(A,B,C)))
 
@@ -76,7 +76,7 @@ list L (from the left or the start of the list).


-

#define BOOST_PP_LIST_FOLD_LEFT_D(D,F,P,L)

+

#define BOOST_PP_LIST_FOLD_LEFT_D(D,OP,STATE,LIST)

Can be used inside BOOST_PP_WHILE().


diff --git a/doc/reference/list_fold_left_2nd.htm b/doc/reference/list_fold_left_2nd.htm index c46f73d..442205b 100644 --- a/doc/reference/list_fold_left_2nd.htm +++ b/doc/reference/list_fold_left_2nd.htm @@ -26,11 +26,11 @@
-

#define BOOST_PP_LIST_FOLD_LEFT_2ND(F,P,L)

+

#define BOOST_PP_LIST_FOLD_LEFT_2ND(OP,STATE,LIST)

Same as BOOST_PP_LIST_FOLD_LEFT(), but implemented independently.


-

#define BOOST_PP_LIST_FOLD_LEFT_2ND_D(D,F,P,L)

+

#define BOOST_PP_LIST_FOLD_LEFT_2ND_D(D,OP,STATE,LIST)

Can be used inside BOOST_PP_WHILE().


diff --git a/doc/reference/list_fold_right.htm b/doc/reference/list_fold_right.htm index 206a848..73dff04 100644 --- a/doc/reference/list_fold_right.htm +++ b/doc/reference/list_fold_right.htm @@ -26,23 +26,23 @@
-

#define BOOST_PP_LIST_FOLD_RIGHT(F,L,P)

-

Iterates F(D,X,P) for each element X of the -list L (from the right or the end of the list).

+

#define BOOST_PP_LIST_FOLD_RIGHT(OP,LIST,STATE)

+

Iterates OP(D,X,STATE) for each element X of the +list LIST (from the right or the end of the list).

In other words, expands to:

-  F
+  OP
   ( D
-  , BOOST_PP_LIST_AT(L,0)
-  , ... F
+  , BOOST_PP_LIST_AT(LIST,0)
+  , ... OP
         ( D
-        , BOOST_PP_LIST_AT(L,BOOST_PP_SUB(BOOST_PP_LIST_SIZE(L),2))
-        , F
+        , BOOST_PP_LIST_AT(LIST,BOOST_PP_SUB(BOOST_PP_LIST_SIZE(LIST),2))
+        , OP
           ( D
-          , BOOST_PP_LIST_AT(L,BOOST_PP_SUB(BOOST_PP_LIST_SIZE(L),1))
-          , P
+          , BOOST_PP_LIST_AT(LIST,BOOST_PP_SUB(BOOST_PP_LIST_SIZE(LIST),1))
+          , STATE
           )
         ) ...
   )
@@ -51,7 +51,7 @@ list L (from the right or the end of the list).

For example,

-  #define TEST(D,X,P) BOOST_PP_CAT(P,X)
+  #define TEST(D,X,STATE) BOOST_PP_CAT(STATE,X)
   BOOST_PP_LIST_FOLD_RIGHT(TEST,_,BOOST_PP_TUPLE_TO_LIST(3,(A,B,C)))
 
@@ -74,7 +74,7 @@ list L (from the right or the end of the list).


-

#define BOOST_PP_LIST_FOLD_RIGHT_D(D,F,L,P)

+

#define BOOST_PP_LIST_FOLD_RIGHT_D(D,OP,LIST,STATE)

Can be used inside BOOST_PP_WHILE().


diff --git a/doc/reference/list_fold_right_2nd.htm b/doc/reference/list_fold_right_2nd.htm index 6f0715d..c2f6d76 100644 --- a/doc/reference/list_fold_right_2nd.htm +++ b/doc/reference/list_fold_right_2nd.htm @@ -26,11 +26,11 @@
-

#define BOOST_PP_LIST_FOLD_RIGHT_2ND(F,L,P)

+

#define BOOST_PP_LIST_FOLD_RIGHT_2ND(OP,LIST,STATE)

Same as BOOST_PP_LIST_FOLD_RIGHT(), but implemented independently.


-

#define BOOST_PP_LIST_FOLD_RIGHT_2ND_D(D,F,L,P)

+

#define BOOST_PP_LIST_FOLD_RIGHT_2ND_D(D,OP,LIST,STATE)

Can be used inside BOOST_PP_WHILE().


diff --git a/doc/reference/list_for_each.htm b/doc/reference/list_for_each.htm index c7f0b01..cc39830 100644 --- a/doc/reference/list_for_each.htm +++ b/doc/reference/list_for_each.htm @@ -26,23 +26,23 @@
-

#define BOOST_PP_LIST_FOR_EACH(F,P,L)

-

Repeats F(R,P,BOOST_PP_LIST_AT(L,I)) for each I = [0, -BOOST_PP_LIST_SIZE(L)[.

+

#define BOOST_PP_LIST_FOR_EACH(MACRO,DATA,LIST)

+

Repeats MACRO(R,DATA,BOOST_PP_LIST_AT(LIST,INDEX)) for each INDEX = [0, +BOOST_PP_LIST_SIZE(LIST)[.

In other words, expands to the sequence:

-  F(R,P,BOOST_PP_LIST_AT(L,0))
-  F(R,P,BOOST_PP_LIST_AT(L,1))
+  MACRO(R,DATA,BOOST_PP_LIST_AT(LIST,0))
+  MACRO(R,DATA,BOOST_PP_LIST_AT(LIST,1))
   ...
-  F(R,P,BOOST_PP_LIST_AT(L,BOOST_PP_DEC(BOOST_PP_LIST_SIZE(L))))
+  MACRO(R,DATA,BOOST_PP_LIST_AT(LIST,BOOST_PP_DEC(BOOST_PP_LIST_SIZE(LIST))))
 

For example,

-  #define TEST(R,P,X) BOOST_PP_CAT(P,X)();
+  #define TEST(R,DATA,X) BOOST_PP_CAT(DATA,X)();
   BOOST_PP_LIST_FOR_EACH(TEST,prefix_,BOOST_PP_TUPLE_TO_LIST(3,(A,B,C)))
 
@@ -70,7 +70,7 @@
-

#define BOOST_PP_LIST_FOR_EACH_R(R,F,P,L)

+

#define BOOST_PP_LIST_FOR_EACH_R(R,MACRO,DATA,LIST)

Can be used inside BOOST_PP_FOR().


diff --git a/doc/reference/list_for_each_i.htm b/doc/reference/list_for_each_i.htm index 9383793..246c699 100644 --- a/doc/reference/list_for_each_i.htm +++ b/doc/reference/list_for_each_i.htm @@ -26,23 +26,23 @@
-

#define BOOST_PP_LIST_FOR_EACH_I(F,P,L)

-

Repeats F(R,P,I,BOOST_PP_LIST_AT(L,I)) for each I = [0, -BOOST_PP_LIST_SIZE(L)[.

+

#define BOOST_PP_LIST_FOR_EACH_I(MACRO,DATA,LIST)

+

Repeats MACRO(R,DATA,INDEX,BOOST_PP_LIST_AT(LIST,INDEX)) for each INDEX = [0, +BOOST_PP_LIST_SIZE(LIST)[.

In other words, expands to the sequence:

-  F(R,P,0,BOOST_PP_LIST_AT(L,0))
-  F(R,P,1,BOOST_PP_LIST_AT(L,1))
+  MACRO(R,DATA,0,BOOST_PP_LIST_AT(LIST,0))
+  MACRO(R,DATA,1,BOOST_PP_LIST_AT(LIST,1))
   ...
-  F(R,P,BOOST_PP_DEC(BOOST_PP_LIST_SIZE(L)),BOOST_PP_LIST_AT(L,BOOST_PP_DEC(BOOST_PP_LIST_SIZE(L))))
+  MACRO(R,DATA,BOOST_PP_DEC(BOOST_PP_LIST_SIZE(LIST)),BOOST_PP_LIST_AT(LIST,BOOST_PP_DEC(BOOST_PP_LIST_SIZE(LIST))))
 

For example,

-  #define TEST(R,P,I,X) BOOST_PP_CAT(P,X)(I);
+  #define TEST(R,DATA,INDEX,X) BOOST_PP_CAT(DATA,X)(INDEX);
   BOOST_PP_LIST_FOR_EACH_I(TEST,prefix_,BOOST_PP_TUPLE_TO_LIST(3,(A,B,C)))
 
@@ -59,7 +59,7 @@
-

#define BOOST_PP_LIST_FOR_EACH_I_R(R,F,P,L)

+

#define BOOST_PP_LIST_FOR_EACH_I_R(R,MACRO,DATA,LIST)

Can be used inside BOOST_PP_FOR().


diff --git a/doc/reference/list_for_each_product.htm b/doc/reference/list_for_each_product.htm index d1bfba9..17af68f 100644 --- a/doc/reference/list_for_each_product.htm +++ b/doc/reference/list_for_each_product.htm @@ -26,9 +26,9 @@
-

#define BOOST_PP_LIST_FOR_EACH_PRODUCT(F,N,T_OF_L)

-

Repeats F(R,X) for each element X of the -cartesian product of the lists of the N-tuple T_OF_L.

+

#define BOOST_PP_LIST_FOR_EACH_PRODUCT(MACRO,SIZE_OF_TUPLE,TUPLE_OF_LISTS)

+

Repeats MACRO(R,X) for each element X of the +cartesian product of the lists of the SIZE_OF_TUPLE-tuple TUPLE_OF_LISTS.

This macro is useful for generating code to avoid combinatorial explosion.

@@ -70,7 +70,7 @@ explosion.


-

#define BOOST_PP_LIST_FOR_EACH_PRODUCT_R(R,F,N,T_OF_L)

+

#define BOOST_PP_LIST_FOR_EACH_PRODUCT_R(R,MACRO,SIZE_OF_TUPLE,TUPLE_OF_LISTS)

Can be used inside BOOST_PP_FOR().


diff --git a/doc/reference/list_rest_n.htm b/doc/reference/list_rest_n.htm index 9f55d0f..ca4c753 100644 --- a/doc/reference/list_rest_n.htm +++ b/doc/reference/list_rest_n.htm @@ -26,9 +26,9 @@
-

#define BOOST_PP_LIST_REST_N(N,L)

-

Expands to a list of all but the first N elements of the -list L.

+

#define BOOST_PP_LIST_REST_N(COUNT,LIST)

+

Expands to a list of all but the first COUNT elements of the +list LIST.

For example,

@@ -59,7 +59,7 @@ list L.


-

#define BOOST_PP_LIST_REST_N_D(D,N,L)

+

#define BOOST_PP_LIST_REST_N_D(D,COUNT,LIST)

Can be used inside BOOST_PP_WHILE().


diff --git a/doc/reference/list_reverse.htm b/doc/reference/list_reverse.htm index d993e1e..2a3578f 100644 --- a/doc/reference/list_reverse.htm +++ b/doc/reference/list_reverse.htm @@ -26,7 +26,7 @@
-

#define BOOST_PP_LIST_REVERSE(L)

+

#define BOOST_PP_LIST_REVERSE(LIST)

List reversal.

For example,

@@ -53,7 +53,7 @@
-

#define BOOST_PP_LIST_REVERSE_D(D,L)

+

#define BOOST_PP_LIST_REVERSE_D(D,LIST)

Can be used inside BOOST_PP_WHILE().


diff --git a/doc/reference/list_size.htm b/doc/reference/list_size.htm index 40cb1c8..71b4a37 100644 --- a/doc/reference/list_size.htm +++ b/doc/reference/list_size.htm @@ -26,7 +26,7 @@
-

#define BOOST_PP_LIST_SIZE(L)

+

#define BOOST_PP_LIST_SIZE(LIST)

Expands to the number of elements in the list.

For example,

@@ -49,7 +49,7 @@
-

#define BOOST_PP_LIST_SIZE_D(D,L)

+

#define BOOST_PP_LIST_SIZE_D(D,LIST)

Can be used inside BOOST_PP_WHILE().


diff --git a/doc/reference/list_to_tuple.htm b/doc/reference/list_to_tuple.htm index 519768f..3ad9eb4 100644 --- a/doc/reference/list_to_tuple.htm +++ b/doc/reference/list_to_tuple.htm @@ -26,7 +26,7 @@
-

#define BOOST_PP_LIST_TO_TUPLE(L)

+

#define BOOST_PP_LIST_TO_TUPLE(LIST)

Converts the list to a tuple.

For example,

@@ -55,7 +55,7 @@
-

#define BOOST_PP_LIST_TO_TUPLE_R(R,L)

+

#define BOOST_PP_LIST_TO_TUPLE_R(R,LIST)

Can be used inside BOOST_PP_FOR().


diff --git a/doc/reference/list_transform.htm b/doc/reference/list_transform.htm index eccc436..ebde89a 100644 --- a/doc/reference/list_transform.htm +++ b/doc/reference/list_transform.htm @@ -26,17 +26,17 @@
-

#define BOOST_PP_LIST_TRANSFORM(F,P,L)

-

Applies the macro F(D,P,X) to each element X +

#define BOOST_PP_LIST_TRANSFORM(OP,DATA,LIST)

+

Applies the macro OP(D,DATA,X) to each element X of the list producing a new list.

In other words, expands to:

-  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(OP(D,DATA,BOOST_PP_LIST_AT(LIST,0)),
+  BOOST_PP_LIST_CONS(OP(D,DATA,BOOST_PP_LIST_AT(LIST,1)),
   ...
-  BOOST_PP_LIST_CONS(F(D,P,BOOST_PP_LIST_AT(L,BOOST_PP_DEC(BOOST_PP_LIST_SIZE(L)))),
+  BOOST_PP_LIST_CONS(OP(D,DATA,BOOST_PP_LIST_AT(LIST,BOOST_PP_DEC(BOOST_PP_LIST_SIZE(LIST)))),
   BOOST_PP_LIST_NIL) ... ))
 
@@ -65,7 +65,7 @@ of the list producing a new list.


-

#define BOOST_PP_LIST_TRANSFORM_D(D,F,P,L)

+

#define BOOST_PP_LIST_TRANSFORM_D(D,OP,DATA,LIST)

Can be used inside BOOST_PP_WHILE().


diff --git a/doc/reference/repeat.htm b/doc/reference/repeat.htm index f506816..9a0712d 100644 --- a/doc/reference/repeat.htm +++ b/doc/reference/repeat.htm @@ -26,19 +26,19 @@
-

#define BOOST_PP_REPEAT(N,M,P)

-

Repeats the macro M(I,P) for I = [0,N[.

+

#define BOOST_PP_REPEAT(COUNT,MACRO,DATA)

+

Repeats the macro MACRO(INDEX,DATA) for INDEX = [0,COUNT[.

In other words, expands to the sequence:

-  M(0,P) M(1,P) ... M(BOOST_PP_DEC(N),P)
+  MACRO(0,DATA) MACRO(1,DATA) ... MACRO(BOOST_PP_DEC(COUNT),DATA)
 

For example,

-  #define TEST(I,P) P(I);
+  #define TEST(INDEX,DATA) DATA(INDEX);
   BOOST_PP_REPEAT(3,TEST,X)
 
diff --git a/doc/reference/repeat_2nd.htm b/doc/reference/repeat_2nd.htm index bb7f109..26a9f44 100644 --- a/doc/reference/repeat_2nd.htm +++ b/doc/reference/repeat_2nd.htm @@ -26,7 +26,7 @@
-

#define BOOST_PP_REPEAT_2ND(N,M,P)

+

#define BOOST_PP_REPEAT_2ND(COUNT,MACRO,DATA)

Same as BOOST_PP_REPEAT(), but implemented independently.

Test

diff --git a/doc/reference/repeat_3rd.htm b/doc/reference/repeat_3rd.htm index d100b26..130e613 100644 --- a/doc/reference/repeat_3rd.htm +++ b/doc/reference/repeat_3rd.htm @@ -26,7 +26,7 @@
-

#define BOOST_PP_REPEAT_3RD(N,M,P)

+

#define BOOST_PP_REPEAT_3RD(COUNT,MACRO,DATA)

Same as BOOST_PP_REPEAT(), but implemented independently.


diff --git a/doc/reference/repeat_from_to.htm b/doc/reference/repeat_from_to.htm index b302ad8..afa67ef 100644 --- a/doc/reference/repeat_from_to.htm +++ b/doc/reference/repeat_from_to.htm @@ -26,19 +26,19 @@
-

#define BOOST_PP_REPEAT_FROM_TO(S,E,M,P)

-

Repeats the macro M(I,P) for I = [S,E[.

+

#define BOOST_PP_REPEAT_FROM_TO(FIRST,LAST,MACRO,DATA)

+

Repeats the macro MACRO(INDEX,DATA) for INDEX = [FIRST,LAST[.

In other words, expands to the sequence:

-  M(S,P) M(BOOST_PP_INC(S),P) ... M(BOOST_PP_DEC(E),P)
+  MACRO(FIRST,DATA) MACRO(BOOST_PP_INC(FIRST),DATA) ... MACRO(BOOST_PP_DEC(LAST),DATA)
 

For example,

-  #define TEST(I,P) P(I);
+  #define TEST(INDEX,DATA) DATA(INDEX);
   BOOST_PP_REPEAT_FROM_TO(4,7,TEST,X)
 
diff --git a/doc/reference/repeat_from_to_2nd.htm b/doc/reference/repeat_from_to_2nd.htm index 419c7d6..419c034 100644 --- a/doc/reference/repeat_from_to_2nd.htm +++ b/doc/reference/repeat_from_to_2nd.htm @@ -26,7 +26,7 @@
-

#define BOOST_PP_REPEAT_FROM_TO_2ND(S,E,M,P)

+

#define BOOST_PP_REPEAT_FROM_TO_2ND(FIRST,LAST,MACRO,DATA)

Same as BOOST_PP_REPEAT_FROM_TO(), but implemented independently.


diff --git a/doc/reference/repeat_from_to_3rd.htm b/doc/reference/repeat_from_to_3rd.htm index c168f92..a2644a4 100644 --- a/doc/reference/repeat_from_to_3rd.htm +++ b/doc/reference/repeat_from_to_3rd.htm @@ -26,7 +26,7 @@
-

#define BOOST_PP_REPEAT_FROM_TO_3RD(S,E,M,P)

+

#define BOOST_PP_REPEAT_FROM_TO_3RD(FIRST,LAST,MACRO,DATA)

Same as BOOST_PP_REPEAT_FROM_TO(), but implemented independently.


diff --git a/doc/reference/tuple_eat.htm b/doc/reference/tuple_eat.htm index d99071e..0995ea1 100644 --- a/doc/reference/tuple_eat.htm +++ b/doc/reference/tuple_eat.htm @@ -26,8 +26,8 @@
-

#define BOOST_PP_TUPLE_EAT(N)

-

Expands to a macro that eats a tuple of the specified length.

+

#define BOOST_PP_TUPLE_EAT(SIZE_OF_TUPLE)

+

Expands to a macro that eats a tuple of the specified size.

BOOST_PP_TUPLE_EAT() is designed to be used with BOOST_PP_IF() like BOOST_PP_EMPTY().

diff --git a/doc/reference/tuple_elem.htm b/doc/reference/tuple_elem.htm index 7b805c2..346d16c 100644 --- a/doc/reference/tuple_elem.htm +++ b/doc/reference/tuple_elem.htm @@ -26,8 +26,8 @@
-

#define BOOST_PP_TUPLE_ELEM(N,I,T)

-

Expands to the I:th element of an N-tuple.

+

#define BOOST_PP_TUPLE_ELEM(SIZE_OF_TUPLE,INDEX,TUPLE)

+

Expands to the INDEX:th element of an SIZE_OF_TUPLE-tuple.

For example,

diff --git a/doc/reference/tuple_reverse.htm b/doc/reference/tuple_reverse.htm index 066479f..0e337aa 100644 --- a/doc/reference/tuple_reverse.htm +++ b/doc/reference/tuple_reverse.htm @@ -26,7 +26,7 @@
-

#define BOOST_PP_TUPLE_REVERSE(N,T)

+

#define BOOST_PP_TUPLE_REVERSE(SIZE_OF_TUPLE,TUPLE)

Tuple reversal.

For example,

diff --git a/doc/reference/tuple_to_list.htm b/doc/reference/tuple_to_list.htm index 5614400..268266f 100644 --- a/doc/reference/tuple_to_list.htm +++ b/doc/reference/tuple_to_list.htm @@ -26,7 +26,7 @@
-

#define BOOST_PP_TUPLE_TO_LIST(N,T)

+

#define BOOST_PP_TUPLE_TO_LIST(SIZE_OF_TUPLE,TUPLE)

Converts a tuple to a list.

For example,

diff --git a/doc/reference/while.htm b/doc/reference/while.htm index c1fd689..16d5a99 100644 --- a/doc/reference/while.htm +++ b/doc/reference/while.htm @@ -26,23 +26,23 @@
-

#define BOOST_PP_WHILE(C,F,X)

-

Iterates F(D,X) while C(D,X) is true.

+

#define BOOST_PP_WHILE(PRED,OP,STATE)

+

Iterates OP(D,STATE) while PRED(D,STATE) is true.

In other words, expands to:

-  F(D, ... F(D, F(D,X) ) ... )
+  OP(D, ... OP(D, OP(D,STATE) ) ... )
 
-

The depth of iteration is determined by C(D,X).

+

The depth of iteration is determined by PRED(D,STATE).

For example,

-  #define C(D,X) BOOST_PP_LESS_D(D,BOOST_PP_TUPLE_ELEM(2,0,X),BOOST_PP_TUPLE_ELEM(2,1,X))
-  #define F(D,X) (BOOST_PP_INC(BOOST_PP_TUPLE_ELEM(2,0,X)),BOOST_PP_TUPLE_ELEM(2,1,X))
-  BOOST_PP_WHILE(C,F,(0,3))
+  #define PRED(D,STATE) BOOST_PP_LESS_D(D,BOOST_PP_TUPLE_ELEM(2,0,STATE),BOOST_PP_TUPLE_ELEM(2,1,STATE))
+  #define OP(D,STATE) (BOOST_PP_INC(BOOST_PP_TUPLE_ELEM(2,0,STATE)),BOOST_PP_TUPLE_ELEM(2,1,STATE))
+  BOOST_PP_WHILE(PRED,OP,(0,3))
 

expands to:

@@ -53,11 +53,11 @@

Legend

*/ -#define BOOST_PP_ENUM(N,F,P) BOOST_PP_REPEAT(N,BOOST_PP_ENUM_F,(F,P)) +#define BOOST_PP_ENUM(COUNT,MACRO,DATA) BOOST_PP_REPEAT(COUNT,BOOST_PP_ENUM_F,(MACRO,DATA)) #if !defined(BOOST_NO_COMPILER_CONFIG) && defined(__MWERKS__) # define BOOST_PP_ENUM_F(I,FP) BOOST_PP_COMMA_IF(I) BOOST_PP_TUPLE_ELEM(2,0,FP)(I,BOOST_PP_TUPLE_ELEM(2,1,FP)) diff --git a/include/boost/preprocessor/enum_params.hpp b/include/boost/preprocessor/enum_params.hpp index 4805752..9b82120 100644 --- a/include/boost/preprocessor/enum_params.hpp +++ b/include/boost/preprocessor/enum_params.hpp @@ -21,7 +21,7 @@

In other words, expands to the sequence:

-  BOOST_PP_CAT(P,0), BOOST_PP_CAT(P,1), ..., BOOST_PP_CAT(P,BOOST_PP_DEC(N))
+  BOOST_PP_CAT(PARAM,0), BOOST_PP_CAT(PARAM,1), ..., BOOST_PP_CAT(PARAM,BOOST_PP_DEC(COUNT))
 

For example,

@@ -46,7 +46,7 @@
  • repeat_test.cpp
  • */ -#define BOOST_PP_ENUM_PARAMS(N,P) BOOST_PP_ENUM(N,BOOST_PP_ENUM_PARAMS_F,P) +#define BOOST_PP_ENUM_PARAMS(COUNT,PARAM) BOOST_PP_ENUM(COUNT,BOOST_PP_ENUM_PARAMS_F,PARAM) #define BOOST_PP_ENUM_PARAMS_F(I,P) BOOST_PP_CAT(P,I) diff --git a/include/boost/preprocessor/enum_params_with_a_default.hpp b/include/boost/preprocessor/enum_params_with_a_default.hpp index 430dbc7..cb65774 100644 --- a/include/boost/preprocessor/enum_params_with_a_default.hpp +++ b/include/boost/preprocessor/enum_params_with_a_default.hpp @@ -21,7 +21,10 @@

    In other words, expands to the sequence:

    -  BOOST_PP_CAT(P,0) = D, BOOST_PP_CAT(P,1) = D, ..., BOOST_PP_CAT(P,BOOST_PP_DEC(N)) = D
    +  BOOST_PP_CAT(PARAM,0) = DEFAULT,
    +  BOOST_PP_CAT(PARAM,1) = DEFAULT,
    +  ...,
    +  BOOST_PP_CAT(PARAM,BOOST_PP_DEC(COUNT)) = DEFAULT
     

    For example,

    @@ -46,7 +49,7 @@
  • repeat_test.cpp
  • */ -#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)) +#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) diff --git a/include/boost/preprocessor/enum_params_with_defaults.hpp b/include/boost/preprocessor/enum_params_with_defaults.hpp index 58dc55c..4affad9 100644 --- a/include/boost/preprocessor/enum_params_with_defaults.hpp +++ b/include/boost/preprocessor/enum_params_with_defaults.hpp @@ -21,10 +21,10 @@

    In other words, expands to the sequence:

    -  BOOST_PP_CAT(P,0) = BOOST_PP_CAT(D,0),
    -  BOOST_PP_CAT(P,1) = BOOST_PP_CAT(D,1),
    +  BOOST_PP_CAT(PARAM,0) = BOOST_PP_CAT(DEFAULT,0),
    +  BOOST_PP_CAT(PARAM,1) = BOOST_PP_CAT(DEFAULT,1),
       ...,
    -  BOOST_PP_CAT(P,BOOST_PP_DEC(N)) = BOOST_PP_CAT(D,BOOST_PP_DEC(N))
    +  BOOST_PP_CAT(PARAM,BOOST_PP_DEC(COUNT)) = BOOST_PP_CAT(DEFAULT,BOOST_PP_DEC(COUNT))
     

    For example,

    @@ -49,7 +49,7 @@
  • repeat_test.cpp
  • */ -#define BOOST_PP_ENUM_PARAMS_WITH_DEFAULTS(N,P,D) BOOST_PP_ENUM(N,BOOST_PP_ENUM_PARAMS_WITH_DEFAULTS_F,(P,D)) +#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) diff --git a/include/boost/preprocessor/enum_shifted.hpp b/include/boost/preprocessor/enum_shifted.hpp index 912948d..2736fa5 100644 --- a/include/boost/preprocessor/enum_shifted.hpp +++ b/include/boost/preprocessor/enum_shifted.hpp @@ -22,14 +22,14 @@

    In other words, expands to the sequence:

    -  F(1,P), F(2,P), ..., F(BOOST_PP_DEC(N),P)
    +  MACRO(1,DATA), MACRO(2,DATA), ..., MACRO(BOOST_PP_DEC(COUNT),DATA)
     

    For example,

    -  #define TYPED_PARAM(I,P)\
    -    BOOST_PP_CAT(BOOST_PP_TUPLE_ELEM(2,0,P),I) BOOST_PP_CAT(BOOST_PP_TUPLE_ELEM(2,1,P),I)
    +  #define TYPED_PARAM(INDEX,DATA)\
    +    BOOST_PP_CAT(BOOST_PP_TUPLE_ELEM(2,0,DATA),INDEX) BOOST_PP_CAT(BOOST_PP_TUPLE_ELEM(2,1,DATA),INDEX)
       BOOST_PP_ENUM_SHIFTED(3,TYPED_PARAM,(X,x))
     
    @@ -44,7 +44,7 @@
  • BOOST_PP_REPEAT()
  • */ -#define BOOST_PP_ENUM_SHIFTED(N,F,P) BOOST_PP_ENUM(BOOST_PP_DEC(N),BOOST_PP_ENUM_SHIFTED_F,(F,P)) +#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,FP) BOOST_PP_TUPLE_ELEM(2,0,FP)(BOOST_PP_INC(I),BOOST_PP_TUPLE_ELEM(2,1,FP)) diff --git a/include/boost/preprocessor/enum_shifted_params.hpp b/include/boost/preprocessor/enum_shifted_params.hpp index fed6396..12d195a 100644 --- a/include/boost/preprocessor/enum_shifted_params.hpp +++ b/include/boost/preprocessor/enum_shifted_params.hpp @@ -21,7 +21,7 @@

    In other words, expands to the sequence:

    -  BOOST_PP_CAT(P,1), BOOST_PP_CAT(P,2), ..., BOOST_PP_CAT(P,BOOST_PP_DEC(N))
    +  BOOST_PP_CAT(PARAM,1), BOOST_PP_CAT(PARAM,2), ..., BOOST_PP_CAT(PARAM,BOOST_PP_DEC(COUNT))
     

    For example,

    @@ -51,7 +51,7 @@
  • repeat_2nd_test.cpp
  • */ -#define BOOST_PP_ENUM_SHIFTED_PARAMS(N,P) BOOST_PP_ENUM_SHIFTED(N,BOOST_PP_ENUM_SHIFTED_PARAMS_F,P) +#define BOOST_PP_ENUM_SHIFTED_PARAMS(COUNT,PARAM) BOOST_PP_ENUM_SHIFTED(COUNT,BOOST_PP_ENUM_SHIFTED_PARAMS_F,PARAM) #define BOOST_PP_ENUM_SHIFTED_PARAMS_F(I,P) BOOST_PP_CAT(P,I) diff --git a/include/boost/preprocessor/expr_if.hpp b/include/boost/preprocessor/expr_if.hpp index eb99a10..2f34440 100644 --- a/include/boost/preprocessor/expr_if.hpp +++ b/include/boost/preprocessor/expr_if.hpp @@ -15,7 +15,9 @@ #include -/**

    Expands to E if C != 0 and to nothing if C == 0.

    +/**

    Expands to EXPR if COND != 0 and to nothing if COND == 0.

    + +

    COND must expand to an integer literal.

    For example, BOOST_PP_EXPR_IF(1,^) expands to ^.

    @@ -24,7 +26,7 @@
  • BOOST_PP_IF()
  • */ -#define BOOST_PP_EXPR_IF(C,E) BOOST_PP_EXPR_IF_BOOL(BOOST_PP_BOOL(C),E) +#define BOOST_PP_EXPR_IF(COND,EXPR) BOOST_PP_EXPR_IF_BOOL(BOOST_PP_BOOL(COND),EXPR) #define BOOST_PP_EXPR_IF_BOOL(C,E) BOOST_PP_EXPR_IF_BOOL_DELAY(C,E) #define BOOST_PP_EXPR_IF_BOOL_DELAY(C,E) BOOST_PP_EXPR_IF_BOOL##C(E) diff --git a/include/boost/preprocessor/for.hpp b/include/boost/preprocessor/for.hpp index ae0a93f..b353841 100644 --- a/include/boost/preprocessor/for.hpp +++ b/include/boost/preprocessor/for.hpp @@ -16,24 +16,24 @@ #include #include -/**

    Repeats I(R,X) and iterates F(R,X) while -C(R,X) is true.

    +/**

    Repeats MACRO(R,STATE) and iterates OP(R,STATE) while +PRED(R,STATE) is true.

    In other words, expands to the sequence:

    -  I(R,X)  I(R,F(R,X))  I(R,F(R,F(R,X)))  ...  I(R,F(R,F(...F(R,X)...)))
    +  MACRO(R,STATE)  MACRO(R,OP(R,STATE))  MACRO(R,OP(R,OP(R,STATE)))  ...  MACRO(R,OP(R,OP(...OP(R,STATE)...)))
     
    -

    The length of the sequence is determined by C(R,X).

    +

    The length of the sequence is determined by PRED(R,STATE).

    For example,

    -  #define C(R,X) BOOST_PP_LESS(BOOST_PP_TUPLE_ELEM(2,0,X),BOOST_PP_TUPLE_ELEM(2,1,X))
    -  #define F(R,X) (BOOST_PP_INC(BOOST_PP_TUPLE_ELEM(2,0,X)),BOOST_PP_TUPLE_ELEM(2,1,X))
    -  #define I(R,X) BOOST_PP_TUPLE_ELEM(2,0,X)
    -  BOOST_PP_FOR((0,3),C,F,I)
    +  #define PRED(R,STATE) BOOST_PP_LESS(BOOST_PP_TUPLE_ELEM(2,0,STATE),BOOST_PP_TUPLE_ELEM(2,1,STATE))
    +  #define OP(R,STATE) (BOOST_PP_INC(BOOST_PP_TUPLE_ELEM(2,0,STATE)),BOOST_PP_TUPLE_ELEM(2,1,STATE))
    +  #define MACRO(R,STATE) BOOST_PP_TUPLE_ELEM(2,0,STATE)
    +  BOOST_PP_FOR((0,3),PRED,OP,MACRO)
     

    expands to:

    @@ -44,19 +44,19 @@

    Legend

      -
    • X is the current state of iteration. The state is usually a tuple.
    • -
    • C is the condition for iteration. It must expand to a decimal +
    • STATE is the current state of iteration. The state is usually a tuple.
    • +
    • PRED is the condition for iteration. It must expand to a decimal integer literal.
    • -
    • F 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.
    • -
    • I is the state instantiation macro.
    • +
    • OP is the iterated macro. Note that if the state is a tuple, then + OP(R,STATE) usually expands to a tuple of the same number of elements.
    • +
    • MACRO is the state instantiation macro.
    • R 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.
    • + directly. For each macro using BOOST_PP_FOR(), e.g. BOOST_PP_LIST_FOR_EACH(), + there is a version of the macro, e.g. BOOST_PP_LIST_FOR_EACH_R(), 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.

    BOOST_PP_REPEAT() vs BOOST_PP_FOR()

    @@ -76,7 +76,7 @@ invoking BOOST_PP_FOR##R() directly.

  • for_test.cpp
  • */ -#define BOOST_PP_FOR(X,C,F,I) BOOST_PP_FOR0(X,C,F,I) +#define BOOST_PP_FOR(STATE,PRED,OP,MACRO) BOOST_PP_FOR0(STATE,PRED,OP,MACRO) #define BOOST_PP_FOR_C0(C,R,X,I) BOOST_PP_IF(C(R,X),I,BOOST_PP_TUPLE2_EAT) #define BOOST_PP_FOR_C1(C,R,X) BOOST_PP_IF(C(R,X),BOOST_PP_FOR##R,BOOST_PP_TUPLE4_EAT) diff --git a/include/boost/preprocessor/if.hpp b/include/boost/preprocessor/if.hpp index 158cbf3..ba6229f 100644 --- a/include/boost/preprocessor/if.hpp +++ b/include/boost/preprocessor/if.hpp @@ -16,8 +16,10 @@ #include #include -/**

    Expands to T if C != 0 and E if -C == 0.

    +/**

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

    + +

    COND must expand to an integer literal.

    For example, BOOST_PP_IF(0,1,2) expands to 2.

    @@ -31,7 +33,7 @@
  • preprocessor_test.cpp
  • */ -#define BOOST_PP_IF(C,T,E) BOOST_PP_IF_BOOL(BOOST_PP_BOOL(C))(E,T) +#define BOOST_PP_IF(COND,THEN,ELSE) BOOST_PP_IF_BOOL(BOOST_PP_BOOL(COND))(ELSE,THEN) #define BOOST_PP_IF_BOOL(C) BOOST_PP_IF_BOOL_DELAY(C) #define BOOST_PP_IF_BOOL_DELAY(C) BOOST_PP_TUPLE2_ELEM##C diff --git a/include/boost/preprocessor/limits.hpp b/include/boost/preprocessor/limits.hpp index f23e7fc..0b14467 100644 --- a/include/boost/preprocessor/limits.hpp +++ b/include/boost/preprocessor/limits.hpp @@ -39,7 +39,7 @@ and BOOST_PP_REPEAT family).

    */ #define BOOST_PP_LIMIT_MAG 128 -/**

    Expands to the maximum tuple length supported by the library.

    */ +/**

    Expands to the maximum tuple size supported by the library.

    */ #define BOOST_PP_LIMIT_TUPLE 16 /**

    Obsolete. Use BOOST_PP_LIMIT_DIM.

    */ diff --git a/include/boost/preprocessor/list/adt.hpp b/include/boost/preprocessor/list/adt.hpp index 98eda39..8378322 100644 --- a/include/boost/preprocessor/list/adt.hpp +++ b/include/boost/preprocessor/list/adt.hpp @@ -64,23 +64,23 @@ and BOOST_PP_LIST_FOLD_RIGHT_2ND():

    )
    */ -#define BOOST_PP_LIST_CONS(H,T) (H,T,1) +#define BOOST_PP_LIST_CONS(FIRST,REST) (FIRST,REST,1) /**

    List nil constructor.

    */ #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(L) BOOST_PP_TUPLE_ELEM(3,2,L) +# define BOOST_PP_LIST_IS_CONS(LIST) BOOST_PP_TUPLE_ELEM(3,2,LIST) #else -# define BOOST_PP_LIST_IS_CONS(L) BOOST_PP_TUPLE3_ELEM2 L +# define BOOST_PP_LIST_IS_CONS(LIST) BOOST_PP_TUPLE3_ELEM2 LIST #endif /**

    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(L) BOOST_PP_NOT(BOOST_PP_TUPLE_ELEM(3,2,L)) +# define BOOST_PP_LIST_IS_NIL(LIST) BOOST_PP_NOT(BOOST_PP_TUPLE_ELEM(3,2,LIST)) #else -# define BOOST_PP_LIST_IS_NIL(L) BOOST_PP_NOT(BOOST_PP_TUPLE3_ELEM2 L) +# define BOOST_PP_LIST_IS_NIL(LIST) BOOST_PP_NOT(BOOST_PP_TUPLE3_ELEM2 LIST) #endif /**

    Expands to the first element of the list. The list must not be nil.

    @@ -94,9 +94,9 @@ and BOOST_PP_LIST_FOLD_RIGHT_2ND():

    expands to 1.

    */ #if !defined(BOOST_NO_COMPILER_CONFIG) && defined(__MWERKS__) -# define BOOST_PP_LIST_FIRST(L) BOOST_PP_TUPLE_ELEM(3,0,L) +# define BOOST_PP_LIST_FIRST(LIST) BOOST_PP_TUPLE_ELEM(3,0,LIST) #else -# define BOOST_PP_LIST_FIRST(L) BOOST_PP_TUPLE3_ELEM0 L +# define BOOST_PP_LIST_FIRST(LIST) BOOST_PP_TUPLE3_ELEM0 LIST #endif /**

    Expands to a list of all but the first element of the list.

    @@ -116,8 +116,8 @@ and BOOST_PP_LIST_FOLD_RIGHT_2ND():

    */ #if !defined(BOOST_NO_COMPILER_CONFIG) && defined(__MWERKS__) -# define BOOST_PP_LIST_REST(L) BOOST_PP_TUPLE_ELEM(3,1,L) +# define BOOST_PP_LIST_REST(LIST) BOOST_PP_TUPLE_ELEM(3,1,LIST) #else -# define BOOST_PP_LIST_REST(L) BOOST_PP_TUPLE3_ELEM1 L +# define BOOST_PP_LIST_REST(LIST) BOOST_PP_TUPLE3_ELEM1 LIST #endif #endif diff --git a/include/boost/preprocessor/list/append.hpp b/include/boost/preprocessor/list/append.hpp index 0e7cfd7..651c0db 100644 --- a/include/boost/preprocessor/list/append.hpp +++ b/include/boost/preprocessor/list/append.hpp @@ -42,9 +42,9 @@
  • list_test.cpp
  • */ -#define BOOST_PP_LIST_APPEND(L,R) BOOST_PP_LIST_APPEND_D(0,L,R) +#define BOOST_PP_LIST_APPEND(LIST_1ST,LIST_2ND) BOOST_PP_LIST_APPEND_D(0,LIST_1ST,LIST_2ND) /**

    Can be used inside BOOST_PP_WHILE().

    */ -#define BOOST_PP_LIST_APPEND_D(D,L,R) BOOST_PP_LIST_FOLD_RIGHT_D(D,BOOST_PP_LIST_APPEND_F,L,R) +#define BOOST_PP_LIST_APPEND_D(D,LIST_1ST,LIST_2ND) BOOST_PP_LIST_FOLD_RIGHT_D(D,BOOST_PP_LIST_APPEND_F,LIST_1ST,LIST_2ND) #define BOOST_PP_LIST_APPEND_F(D,H,P) (H,P,1) #endif diff --git a/include/boost/preprocessor/list/at.hpp b/include/boost/preprocessor/list/at.hpp index bd7eb27..7a09db6 100644 --- a/include/boost/preprocessor/list/at.hpp +++ b/include/boost/preprocessor/list/at.hpp @@ -15,7 +15,7 @@ #include -/**

    Expands to the I:th element of the list L. The +/**

    Expands to the INDEX:th element of the list LIST. The first element is at index 0.

    For example,

    @@ -36,8 +36,8 @@ first element is at index 0.

  • list_test.cpp
  • */ -#define BOOST_PP_LIST_AT(L,I) BOOST_PP_LIST_AT_D(0,L,I) +#define BOOST_PP_LIST_AT(LIST,INDEX) BOOST_PP_LIST_AT_D(0,LIST,INDEX) /**

    Can be used inside BOOST_PP_WHILE().

    */ -#define BOOST_PP_LIST_AT_D(D,L,I) BOOST_PP_LIST_FIRST(BOOST_PP_LIST_REST_N_D(D,I,L)) +#define BOOST_PP_LIST_AT_D(D,LIST,INDEX) BOOST_PP_LIST_FIRST(BOOST_PP_LIST_REST_N_D(D,INDEX,LIST)) #endif diff --git a/include/boost/preprocessor/list/cat.hpp b/include/boost/preprocessor/list/cat.hpp index 09f583a..89411e3 100644 --- a/include/boost/preprocessor/list/cat.hpp +++ b/include/boost/preprocessor/list/cat.hpp @@ -40,9 +40,9 @@
  • list_test.cpp
  • */ -#define BOOST_PP_LIST_CAT(L) BOOST_PP_LIST_CAT_D(0,L) +#define BOOST_PP_LIST_CAT(LIST) BOOST_PP_LIST_CAT_D(0,LIST) /**

    Can be used inside BOOST_PP_WHILE().

    */ -#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_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_F(D,P,H) BOOST_PP_CAT(P,H) #endif diff --git a/include/boost/preprocessor/list/enum.hpp b/include/boost/preprocessor/list/enum.hpp index beb9e63..f04e9c7 100644 --- a/include/boost/preprocessor/list/enum.hpp +++ b/include/boost/preprocessor/list/enum.hpp @@ -35,9 +35,9 @@
  • BOOST_PP_LIST_FOR_EACH_I()
  • */ -#define BOOST_PP_LIST_ENUM(L) BOOST_PP_LIST_ENUM_R(0,L) +#define BOOST_PP_LIST_ENUM(LIST) BOOST_PP_LIST_ENUM_R(0,LIST) /**

    Can be used inside BOOST_PP_FOR().

    */ -#define BOOST_PP_LIST_ENUM_R(R,L) BOOST_PP_LIST_FOR_EACH_I_R(R,BOOST_PP_LIST_ENUM_F,_,L) +#define BOOST_PP_LIST_ENUM_R(R,LIST) BOOST_PP_LIST_FOR_EACH_I_R(R,BOOST_PP_LIST_ENUM_F,_,LIST) #define BOOST_PP_LIST_ENUM_F(R,_,I,X) BOOST_PP_COMMA_IF(I) X #endif diff --git a/include/boost/preprocessor/list/filter.hpp b/include/boost/preprocessor/list/filter.hpp index ad884e7..c76af83 100644 --- a/include/boost/preprocessor/list/filter.hpp +++ b/include/boost/preprocessor/list/filter.hpp @@ -16,7 +16,7 @@ #include /**

    Expands to a list containing all the elements X of the list -for which F(D,P,X) is true.

    +for which PRED(D,DATA,X) is true.

    For example,

    @@ -41,10 +41,10 @@ for which F(D,P,X) is true.

  • list_test.cpp
  • */ -#define BOOST_PP_LIST_FILTER(F,P,L) BOOST_PP_LIST_FILTER_D(0,F,P,L) +#define BOOST_PP_LIST_FILTER(PRED,DATA,LIST) BOOST_PP_LIST_FILTER_D(0,PRED,DATA,LIST) /**

    Can be used inside BOOST_PP_WHILE().

    */ -#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)))) +#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,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) diff --git a/include/boost/preprocessor/list/first_n.hpp b/include/boost/preprocessor/list/first_n.hpp index 46ee8e7..66d11a2 100644 --- a/include/boost/preprocessor/list/first_n.hpp +++ b/include/boost/preprocessor/list/first_n.hpp @@ -17,8 +17,8 @@ #include #include -/**

    Expands to a list of the first N elements of the list -L.

    +/**

    Expands to a list of the first COUNT elements of the list +LIST.

    For example,

    @@ -47,10 +47,10 @@
  • list_test.cpp
  • */ -#define BOOST_PP_LIST_FIRST_N(N,L) BOOST_PP_LIST_FIRST_N_D(0,N,L) +#define BOOST_PP_LIST_FIRST_N(COUNT,LIST) BOOST_PP_LIST_FIRST_N_D(0,COUNT,LIST) /**

    Can be used inside BOOST_PP_WHILE().

    */ -#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)))) +#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,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))) diff --git a/include/boost/preprocessor/list/fold_left.hpp b/include/boost/preprocessor/list/fold_left.hpp index 6c92a7f..ec65b3e 100644 --- a/include/boost/preprocessor/list/fold_left.hpp +++ b/include/boost/preprocessor/list/fold_left.hpp @@ -16,23 +16,23 @@ #include #include -/**

    Iterates F(D,P,X) for each element X of the -list L (from the left or the start of the list).

    +/**

    Iterates OP(D,STATE,X) for each element X of the +list LIST (from the left or the start of the list).

    In other words, expands to:

    -  F
    +  OP
       ( 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))
    +  , ... OP(D, OP(D,STATE,BOOST_PP_LIST_AT(LIST,0)), BOOST_PP_LIST_AT(LIST,1)) ...
    +  , BOOST_PP_LIST_AT(LIST,BOOST_PP_DEC(BOOST_PP_LIST_SIZE(LIST))
       )
     

    For example,

    -  #define TEST(D,P,X) BOOST_PP_CAT(P,X)
    +  #define TEST(D,STATE,X) BOOST_PP_CAT(STATE,X)
       BOOST_PP_LIST_FOLD_LEFT(TEST,_,BOOST_PP_TUPLE_TO_LIST(3,(A,B,C)))
     
    @@ -63,10 +63,10 @@ list L (from the left or the start of the list).

  • list_test.cpp
  • */ -#define BOOST_PP_LIST_FOLD_LEFT(F,P,L) BOOST_PP_LIST_FOLD_LEFT_D(0,F,P,L) +#define BOOST_PP_LIST_FOLD_LEFT(OP,STATE,LIST) BOOST_PP_LIST_FOLD_LEFT_D(0,OP,STATE,LIST) /**

    Can be used inside BOOST_PP_WHILE().

    */ -#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))) +#define BOOST_PP_LIST_FOLD_LEFT_D(D,OP,STATE,LIST) BOOST_PP_TUPLE_ELEM(3,1,BOOST_PP_WHILE##D(BOOST_PP_LIST_FOLD_LEFT_C,BOOST_PP_LIST_FOLD_LEFT_F,(OP,STATE,LIST))) #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))) diff --git a/include/boost/preprocessor/list/fold_left_2nd.hpp b/include/boost/preprocessor/list/fold_left_2nd.hpp index dc8c89b..df12662 100644 --- a/include/boost/preprocessor/list/fold_left_2nd.hpp +++ b/include/boost/preprocessor/list/fold_left_2nd.hpp @@ -17,10 +17,10 @@ #include /**

    Same as BOOST_PP_LIST_FOLD_LEFT(), but implemented independently.

    */ -#define BOOST_PP_LIST_FOLD_LEFT_2ND(F,P,L) BOOST_PP_LIST_FOLD_LEFT_2ND_D(0,F,P,L) +#define BOOST_PP_LIST_FOLD_LEFT_2ND(OP,STATE,LIST) BOOST_PP_LIST_FOLD_LEFT_2ND_D(0,OP,STATE,LIST) /**

    Can be used inside BOOST_PP_WHILE().

    */ -#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))) +#define BOOST_PP_LIST_FOLD_LEFT_2ND_D(D,OP,STATE,LIST) BOOST_PP_TUPLE_ELEM(3,1,BOOST_PP_WHILE##D(BOOST_PP_LIST_FOLD_LEFT_2ND_C,BOOST_PP_LIST_FOLD_LEFT_2ND_F,(OP,STATE,LIST))) #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))) diff --git a/include/boost/preprocessor/list/fold_right.hpp b/include/boost/preprocessor/list/fold_right.hpp index 74ae965..3399f2d 100644 --- a/include/boost/preprocessor/list/fold_right.hpp +++ b/include/boost/preprocessor/list/fold_right.hpp @@ -15,22 +15,22 @@ #include -/**

    Iterates F(D,X,P) for each element X of the -list L (from the right or the end of the list).

    +/**

    Iterates OP(D,X,STATE) for each element X of the +list LIST (from the right or the end of the list).

    In other words, expands to:

    -  F
    +  OP
       ( D
    -  , BOOST_PP_LIST_AT(L,0)
    -  , ... F
    +  , BOOST_PP_LIST_AT(LIST,0)
    +  , ... OP
             ( D
    -        , BOOST_PP_LIST_AT(L,BOOST_PP_SUB(BOOST_PP_LIST_SIZE(L),2))
    -        , F
    +        , BOOST_PP_LIST_AT(LIST,BOOST_PP_SUB(BOOST_PP_LIST_SIZE(LIST),2))
    +        , OP
               ( D
    -          , BOOST_PP_LIST_AT(L,BOOST_PP_SUB(BOOST_PP_LIST_SIZE(L),1))
    -          , P
    +          , BOOST_PP_LIST_AT(LIST,BOOST_PP_SUB(BOOST_PP_LIST_SIZE(LIST),1))
    +          , STATE
               )
             ) ...
       )
    @@ -39,7 +39,7 @@ list L (from the right or the end of the list).

    For example,

    -  #define TEST(D,X,P) BOOST_PP_CAT(P,X)
    +  #define TEST(D,X,STATE) BOOST_PP_CAT(STATE,X)
       BOOST_PP_LIST_FOLD_RIGHT(TEST,_,BOOST_PP_TUPLE_TO_LIST(3,(A,B,C)))
     
    @@ -60,10 +60,10 @@ list L (from the right or the end of the list).

  • list_test.cpp
  • */ -#define BOOST_PP_LIST_FOLD_RIGHT(F,L,P) BOOST_PP_LIST_FOLD_RIGHT_D(0,F,L,P) +#define BOOST_PP_LIST_FOLD_RIGHT(OP,LIST,STATE) BOOST_PP_LIST_FOLD_RIGHT_D(0,OP,LIST,STATE) /**

    Can be used inside BOOST_PP_WHILE().

    */ -#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))) +#define BOOST_PP_LIST_FOLD_RIGHT_D(D,OP,LIST,STATE) BOOST_PP_TUPLE_ELEM(2,1,BOOST_PP_LIST_FOLD_LEFT_D(D,BOOST_PP_LIST_FOLD_RIGHT_F,(OP,STATE),BOOST_PP_LIST_REVERSE_D(D,LIST))) #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) diff --git a/include/boost/preprocessor/list/fold_right_2nd.hpp b/include/boost/preprocessor/list/fold_right_2nd.hpp index ca78cf6..5dada16 100644 --- a/include/boost/preprocessor/list/fold_right_2nd.hpp +++ b/include/boost/preprocessor/list/fold_right_2nd.hpp @@ -17,10 +17,10 @@ #include /**

    Same as BOOST_PP_LIST_FOLD_RIGHT(), but implemented independently.

    */ -#define BOOST_PP_LIST_FOLD_RIGHT_2ND(F,L,P) BOOST_PP_LIST_FOLD_RIGHT_2ND_D(0,F,L,P) +#define BOOST_PP_LIST_FOLD_RIGHT_2ND(OP,LIST,STATE) BOOST_PP_LIST_FOLD_RIGHT_2ND_D(0,OP,LIST,STATE) /**

    Can be used inside BOOST_PP_WHILE().

    */ -#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))) +#define BOOST_PP_LIST_FOLD_RIGHT_2ND_D(D,OP,LIST,STATE) BOOST_PP_TUPLE_ELEM(2,1,BOOST_PP_LIST_FOLD_LEFT_2ND_D(D,BOOST_PP_LIST_FOLD_RIGHT_2ND_F,(OP,STATE),BOOST_PP_LIST_FOLD_LEFT_2ND_D(D,BOOST_PP_LIST_REVERSE_F,(_,_,0),LIST))) #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) diff --git a/include/boost/preprocessor/list/for_each.hpp b/include/boost/preprocessor/list/for_each.hpp index 4ef7e89..3cc70df 100644 --- a/include/boost/preprocessor/list/for_each.hpp +++ b/include/boost/preprocessor/list/for_each.hpp @@ -15,22 +15,22 @@ #include -/**

    Repeats F(R,P,BOOST_PP_LIST_AT(L,I)) for each I = [0, -BOOST_PP_LIST_SIZE(L)[.

    +/**

    Repeats MACRO(R,DATA,BOOST_PP_LIST_AT(LIST,INDEX)) for each INDEX = [0, +BOOST_PP_LIST_SIZE(LIST)[.

    In other words, expands to the sequence:

    -  F(R,P,BOOST_PP_LIST_AT(L,0))
    -  F(R,P,BOOST_PP_LIST_AT(L,1))
    +  MACRO(R,DATA,BOOST_PP_LIST_AT(LIST,0))
    +  MACRO(R,DATA,BOOST_PP_LIST_AT(LIST,1))
       ...
    -  F(R,P,BOOST_PP_LIST_AT(L,BOOST_PP_DEC(BOOST_PP_LIST_SIZE(L))))
    +  MACRO(R,DATA,BOOST_PP_LIST_AT(LIST,BOOST_PP_DEC(BOOST_PP_LIST_SIZE(LIST))))
     

    For example,

    -  #define TEST(R,P,X) BOOST_PP_CAT(P,X)();
    +  #define TEST(R,DATA,X) BOOST_PP_CAT(DATA,X)();
       BOOST_PP_LIST_FOR_EACH(TEST,prefix_,BOOST_PP_TUPLE_TO_LIST(3,(A,B,C)))
     
    @@ -56,9 +56,9 @@ BOOST_PP_LIST_SIZE(L)[.

  • list_test.cpp
  • */ -#define BOOST_PP_LIST_FOR_EACH(F,P,L) BOOST_PP_LIST_FOR_EACH_R(0,F,P,L) +#define BOOST_PP_LIST_FOR_EACH(MACRO,DATA,LIST) BOOST_PP_LIST_FOR_EACH_R(0,MACRO,DATA,LIST) /**

    Can be used inside BOOST_PP_FOR().

    */ -#define BOOST_PP_LIST_FOR_EACH_R(R,F,P,L) BOOST_PP_LIST_FOR_EACH_I_R(R,BOOST_PP_LIST_FOR_EACH_F,(F,P),L) +#define BOOST_PP_LIST_FOR_EACH_R(R,MACRO,DATA,LIST) BOOST_PP_LIST_FOR_EACH_I_R(R,BOOST_PP_LIST_FOR_EACH_F,(MACRO,DATA),LIST) #define BOOST_PP_LIST_FOR_EACH_F(R,FP,I,X) BOOST_PP_TUPLE_ELEM(2,0,FP)(R,BOOST_PP_TUPLE_ELEM(2,1,FP),X) #endif diff --git a/include/boost/preprocessor/list/for_each_i.hpp b/include/boost/preprocessor/list/for_each_i.hpp index 72c5e30..a2fd025 100644 --- a/include/boost/preprocessor/list/for_each_i.hpp +++ b/include/boost/preprocessor/list/for_each_i.hpp @@ -17,22 +17,22 @@ #include #include -/**

    Repeats F(R,P,I,BOOST_PP_LIST_AT(L,I)) for each I = [0, -BOOST_PP_LIST_SIZE(L)[.

    +/**

    Repeats MACRO(R,DATA,INDEX,BOOST_PP_LIST_AT(LIST,INDEX)) for each INDEX = [0, +BOOST_PP_LIST_SIZE(LIST)[.

    In other words, expands to the sequence:

    -  F(R,P,0,BOOST_PP_LIST_AT(L,0))
    -  F(R,P,1,BOOST_PP_LIST_AT(L,1))
    +  MACRO(R,DATA,0,BOOST_PP_LIST_AT(LIST,0))
    +  MACRO(R,DATA,1,BOOST_PP_LIST_AT(LIST,1))
       ...
    -  F(R,P,BOOST_PP_DEC(BOOST_PP_LIST_SIZE(L)),BOOST_PP_LIST_AT(L,BOOST_PP_DEC(BOOST_PP_LIST_SIZE(L))))
    +  MACRO(R,DATA,BOOST_PP_DEC(BOOST_PP_LIST_SIZE(LIST)),BOOST_PP_LIST_AT(LIST,BOOST_PP_DEC(BOOST_PP_LIST_SIZE(LIST))))
     

    For example,

    -  #define TEST(R,P,I,X) BOOST_PP_CAT(P,X)(I);
    +  #define TEST(R,DATA,INDEX,X) BOOST_PP_CAT(DATA,X)(INDEX);
       BOOST_PP_LIST_FOR_EACH_I(TEST,prefix_,BOOST_PP_TUPLE_TO_LIST(3,(A,B,C)))
     
    @@ -47,10 +47,10 @@ BOOST_PP_LIST_SIZE(L)[.

  • BOOST_PP_FOR() (see for explanation of the R parameter)
  • */ -#define BOOST_PP_LIST_FOR_EACH_I(F,P,L) BOOST_PP_LIST_FOR_EACH_I_R(0,F,P,L) +#define BOOST_PP_LIST_FOR_EACH_I(MACRO,DATA,LIST) BOOST_PP_LIST_FOR_EACH_I_R(0,MACRO,DATA,LIST) /**

    Can be used inside BOOST_PP_FOR().

    */ -#define BOOST_PP_LIST_FOR_EACH_I_R(R,F,P,L) BOOST_PP_FOR##R((F,P,L,0),BOOST_PP_LIST_FOR_EACH_I_C,BOOST_PP_LIST_FOR_EACH_I_F,BOOST_PP_LIST_FOR_EACH_I_I) +#define BOOST_PP_LIST_FOR_EACH_I_R(R,MACRO,DATA,LIST) BOOST_PP_FOR##R((MACRO,DATA,LIST,0),BOOST_PP_LIST_FOR_EACH_I_C,BOOST_PP_LIST_FOR_EACH_I_F,BOOST_PP_LIST_FOR_EACH_I_I) #define BOOST_PP_LIST_FOR_EACH_I_C(R,FPLI) BOOST_PP_TUPLE_ELEM(3,2,BOOST_PP_TUPLE_ELEM(4,2,FPLI)) #define BOOST_PP_LIST_FOR_EACH_I_F(R,FPLI) (BOOST_PP_TUPLE_ELEM(4,0,FPLI),BOOST_PP_TUPLE_ELEM(4,1,FPLI),BOOST_PP_TUPLE_ELEM(3,1,BOOST_PP_TUPLE_ELEM(4,2,FPLI)),BOOST_PP_INC(BOOST_PP_TUPLE_ELEM(4,3,FPLI))) #define BOOST_PP_LIST_FOR_EACH_I_I(R,FPLI) BOOST_PP_TUPLE_ELEM(4,0,FPLI)(R,BOOST_PP_TUPLE_ELEM(4,1,FPLI),BOOST_PP_TUPLE_ELEM(4,3,FPLI),BOOST_PP_TUPLE_ELEM(3,0,BOOST_PP_TUPLE_ELEM(4,2,FPLI))) diff --git a/include/boost/preprocessor/list/for_each_product.hpp b/include/boost/preprocessor/list/for_each_product.hpp index ad0361b..15741a7 100644 --- a/include/boost/preprocessor/list/for_each_product.hpp +++ b/include/boost/preprocessor/list/for_each_product.hpp @@ -19,8 +19,8 @@ #include #include -/**

    Repeats F(R,X) for each element X of the -cartesian product of the lists of the N-tuple T_OF_L.

    +/**

    Repeats MACRO(R,X) for each element X of the +cartesian product of the lists of the SIZE_OF_TUPLE-tuple TUPLE_OF_LISTS.

    This macro is useful for generating code to avoid combinatorial explosion.

    @@ -60,10 +60,10 @@ explosion.

  • list_test.cpp
  • */ -#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) +#define BOOST_PP_LIST_FOR_EACH_PRODUCT(MACRO,SIZE_OF_TUPLE,TUPLE_OF_LISTS) BOOST_PP_LIST_FOR_EACH_PRODUCT_R(0,MACRO,SIZE_OF_TUPLE,TUPLE_OF_LISTS) /**

    Can be used inside BOOST_PP_FOR().

    */ -#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))) +#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) diff --git a/include/boost/preprocessor/list/rest_n.hpp b/include/boost/preprocessor/list/rest_n.hpp index 1850d3c..ff4c95c 100644 --- a/include/boost/preprocessor/list/rest_n.hpp +++ b/include/boost/preprocessor/list/rest_n.hpp @@ -17,8 +17,8 @@ #include #include -/**

    Expands to a list of all but the first N elements of the -list L.

    +/**

    Expands to a list of all but the first COUNT elements of the +list LIST.

    For example,

    @@ -47,10 +47,10 @@ list L.

  • list_test.cpp
  • */ -#define BOOST_PP_LIST_REST_N(N,L) BOOST_PP_LIST_REST_N_D(0,N,L) +#define BOOST_PP_LIST_REST_N(COUNT,LIST) BOOST_PP_LIST_REST_N_D(0,COUNT,LIST) /**

    Can be used inside BOOST_PP_WHILE().

    */ -#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))) +#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,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))) diff --git a/include/boost/preprocessor/list/reverse.hpp b/include/boost/preprocessor/list/reverse.hpp index 95fe49c..b53ec4a 100644 --- a/include/boost/preprocessor/list/reverse.hpp +++ b/include/boost/preprocessor/list/reverse.hpp @@ -39,9 +39,9 @@
  • list_test.cpp
  • */ -#define BOOST_PP_LIST_REVERSE(L) BOOST_PP_LIST_REVERSE_D(0,L) +#define BOOST_PP_LIST_REVERSE(LIST) BOOST_PP_LIST_REVERSE_D(0,LIST) /**

    Can be used inside BOOST_PP_WHILE().

    */ -#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_D(D,LIST) BOOST_PP_LIST_FOLD_LEFT_D(D,BOOST_PP_LIST_REVERSE_F,(_,_,0),LIST) #define BOOST_PP_LIST_REVERSE_F(D,P,H) (H,P,1) #endif diff --git a/include/boost/preprocessor/list/size.hpp b/include/boost/preprocessor/list/size.hpp index 725015b..9d25e76 100644 --- a/include/boost/preprocessor/list/size.hpp +++ b/include/boost/preprocessor/list/size.hpp @@ -36,9 +36,9 @@
  • list_test.cpp
  • */ -#define BOOST_PP_LIST_SIZE(L) BOOST_PP_LIST_SIZE_D(0,L) +#define BOOST_PP_LIST_SIZE(LIST) BOOST_PP_LIST_SIZE_D(0,LIST) /**

    Can be used inside BOOST_PP_WHILE().

    */ -#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_D(D,LIST) BOOST_PP_LIST_FOLD_LEFT_D(D,BOOST_PP_LIST_SIZE_F,0,LIST) #define BOOST_PP_LIST_SIZE_F(D,P,H) BOOST_PP_INC(P) #endif diff --git a/include/boost/preprocessor/list/to_tuple.hpp b/include/boost/preprocessor/list/to_tuple.hpp index 4e19970..bb54808 100644 --- a/include/boost/preprocessor/list/to_tuple.hpp +++ b/include/boost/preprocessor/list/to_tuple.hpp @@ -41,8 +41,8 @@
  • list_test.cpp
  • */ -#define BOOST_PP_LIST_TO_TUPLE(L) BOOST_PP_LIST_TO_TUPLE_R(0,L) +#define BOOST_PP_LIST_TO_TUPLE(LIST) BOOST_PP_LIST_TO_TUPLE_R(0,LIST) /**

    Can be used inside BOOST_PP_FOR().

    */ -#define BOOST_PP_LIST_TO_TUPLE_R(R,L) (BOOST_PP_LIST_ENUM_R(R,L)) +#define BOOST_PP_LIST_TO_TUPLE_R(R,LIST) (BOOST_PP_LIST_ENUM_R(R,LIST)) #endif diff --git a/include/boost/preprocessor/list/transform.hpp b/include/boost/preprocessor/list/transform.hpp index 0aa917c..daf3aea 100644 --- a/include/boost/preprocessor/list/transform.hpp +++ b/include/boost/preprocessor/list/transform.hpp @@ -15,16 +15,16 @@ #include -/**

    Applies the macro F(D,P,X) to each element X +/**

    Applies the macro OP(D,DATA,X) to each element X of the list producing a new list.

    In other words, expands to:

    -  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(OP(D,DATA,BOOST_PP_LIST_AT(LIST,0)),
    +  BOOST_PP_LIST_CONS(OP(D,DATA,BOOST_PP_LIST_AT(LIST,1)),
       ...
    -  BOOST_PP_LIST_CONS(F(D,P,BOOST_PP_LIST_AT(L,BOOST_PP_DEC(BOOST_PP_LIST_SIZE(L)))),
    +  BOOST_PP_LIST_CONS(OP(D,DATA,BOOST_PP_LIST_AT(LIST,BOOST_PP_DEC(BOOST_PP_LIST_SIZE(LIST)))),
       BOOST_PP_LIST_NIL) ... ))
     
    @@ -51,10 +51,10 @@ of the list producing a new list.

  • list_test.cpp
  • */ -#define BOOST_PP_LIST_TRANSFORM(F,P,L) BOOST_PP_LIST_TRANSFORM_D(0,F,P,L) +#define BOOST_PP_LIST_TRANSFORM(OP,DATA,LIST) BOOST_PP_LIST_TRANSFORM_D(0,OP,DATA,LIST) /**

    Can be used inside BOOST_PP_WHILE().

    */ -#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)))) +#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,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) diff --git a/include/boost/preprocessor/repeat.hpp b/include/boost/preprocessor/repeat.hpp index 439483f..9a0d697 100644 --- a/include/boost/preprocessor/repeat.hpp +++ b/include/boost/preprocessor/repeat.hpp @@ -13,18 +13,18 @@ * See http://www.boost.org for most recent version. */ -/**

    Repeats the macro M(I,P) for I = [0,N[.

    +/**

    Repeats the macro MACRO(INDEX,DATA) for INDEX = [0,COUNT[.

    In other words, expands to the sequence:

    -  M(0,P) M(1,P) ... M(BOOST_PP_DEC(N),P)
    +  MACRO(0,DATA) MACRO(1,DATA) ... MACRO(BOOST_PP_DEC(COUNT),DATA)
     

    For example,

    -  #define TEST(I,P) P(I);
    +  #define TEST(INDEX,DATA) DATA(INDEX);
       BOOST_PP_REPEAT(3,TEST,X)
     
    @@ -51,7 +51,7 @@ BOOST_PP_REPEAT_3RD() macros.

  • BOOST_PP_LIMIT_MAG
  • */ -#define BOOST_PP_REPEAT(N,M,P) BOOST_PP_REPEAT_DELAY(N,M,P) +#define BOOST_PP_REPEAT(COUNT,MACRO,DATA) BOOST_PP_REPEAT_DELAY(COUNT,MACRO,DATA) #define BOOST_PP_REPEAT_DELAY(N,M,P) BOOST_PP_REPEAT##N(M,P) #define BOOST_PP_REPEAT0(M,P) diff --git a/include/boost/preprocessor/repeat_2nd.hpp b/include/boost/preprocessor/repeat_2nd.hpp index 77658d6..cd392fc 100644 --- a/include/boost/preprocessor/repeat_2nd.hpp +++ b/include/boost/preprocessor/repeat_2nd.hpp @@ -20,7 +20,7 @@
  • repeat_2nd_test.cpp
  • */ -#define BOOST_PP_REPEAT_2ND(N,M,P) BOOST_PP_REPEAT_2ND_DELAY(N,M,P) +#define BOOST_PP_REPEAT_2ND(COUNT,MACRO,DATA) BOOST_PP_REPEAT_2ND_DELAY(COUNT,MACRO,DATA) #define BOOST_PP_REPEAT_2ND_DELAY(N,M,P) BOOST_PP_REPEAT_2ND##N(M,P) #define BOOST_PP_REPEAT_2ND0(M,P) diff --git a/include/boost/preprocessor/repeat_3rd.hpp b/include/boost/preprocessor/repeat_3rd.hpp index d88175e..2207e1a 100644 --- a/include/boost/preprocessor/repeat_3rd.hpp +++ b/include/boost/preprocessor/repeat_3rd.hpp @@ -14,7 +14,7 @@ */ /**

    Same as BOOST_PP_REPEAT(), but implemented independently.

    */ -#define BOOST_PP_REPEAT_3RD(N,M,P) BOOST_PP_REPEAT_3RD_DELAY(N,M,P) +#define BOOST_PP_REPEAT_3RD(COUNT,MACRO,DATA) BOOST_PP_REPEAT_3RD_DELAY(COUNT,MACRO,DATA) #define BOOST_PP_REPEAT_3RD_DELAY(N,M,P) BOOST_PP_REPEAT_3RD##N(M,P) #define BOOST_PP_REPEAT_3RD0(M,P) diff --git a/include/boost/preprocessor/repeat_from_to.hpp b/include/boost/preprocessor/repeat_from_to.hpp index 00ec641..4ad5e06 100644 --- a/include/boost/preprocessor/repeat_from_to.hpp +++ b/include/boost/preprocessor/repeat_from_to.hpp @@ -17,18 +17,18 @@ #include #include -/**

    Repeats the macro M(I,P) for I = [S,E[.

    +/**

    Repeats the macro MACRO(INDEX,DATA) for INDEX = [FIRST,LAST[.

    In other words, expands to the sequence:

    -  M(S,P) M(BOOST_PP_INC(S),P) ... M(BOOST_PP_DEC(E),P)
    +  MACRO(FIRST,DATA) MACRO(BOOST_PP_INC(FIRST),DATA) ... MACRO(BOOST_PP_DEC(LAST),DATA)
     

    For example,

    -  #define TEST(I,P) P(I);
    +  #define TEST(INDEX,DATA) DATA(INDEX);
       BOOST_PP_REPEAT_FROM_TO(4,7,TEST,X)
     
    @@ -48,6 +48,6 @@
  • repeat_test.cpp
  • */ -#define BOOST_PP_REPEAT_FROM_TO(S,E,M,P) BOOST_PP_REPEAT(BOOST_PP_SUB(E,S),BOOST_PP_REPEAT_FROM_TO_F,(S,M,P)) +#define BOOST_PP_REPEAT_FROM_TO(FIRST,LAST,MACRO,DATA) BOOST_PP_REPEAT(BOOST_PP_SUB(LAST,FIRST),BOOST_PP_REPEAT_FROM_TO_F,(FIRST,MACRO,DATA)) #define BOOST_PP_REPEAT_FROM_TO_F(I,SMP) BOOST_PP_TUPLE_ELEM(3,1,SMP)(BOOST_PP_ADD(I,BOOST_PP_TUPLE_ELEM(3,0,SMP)),BOOST_PP_TUPLE_ELEM(3,2,SMP)) #endif diff --git a/include/boost/preprocessor/repeat_from_to_2nd.hpp b/include/boost/preprocessor/repeat_from_to_2nd.hpp index 32f707a..6d1876a 100644 --- a/include/boost/preprocessor/repeat_from_to_2nd.hpp +++ b/include/boost/preprocessor/repeat_from_to_2nd.hpp @@ -18,6 +18,6 @@ #include /**

    Same as BOOST_PP_REPEAT_FROM_TO(), but implemented independently.

    */ -#define BOOST_PP_REPEAT_FROM_TO_2ND(S,E,M,P) BOOST_PP_REPEAT_2ND(BOOST_PP_SUB(E,S),BOOST_PP_REPEAT_FROM_TO_2ND_F,(S,M,P)) +#define BOOST_PP_REPEAT_FROM_TO_2ND(FIRST,LAST,MACRO,DATA) BOOST_PP_REPEAT_2ND(BOOST_PP_SUB(LAST,FIRST),BOOST_PP_REPEAT_FROM_TO_2ND_F,(FIRST,MACRO,DATA)) #define BOOST_PP_REPEAT_FROM_TO_2ND_F(I,SMP) BOOST_PP_TUPLE_ELEM(3,1,SMP)(BOOST_PP_ADD(I,BOOST_PP_TUPLE_ELEM(3,0,SMP)),BOOST_PP_TUPLE_ELEM(3,2,SMP)) #endif diff --git a/include/boost/preprocessor/repeat_from_to_3rd.hpp b/include/boost/preprocessor/repeat_from_to_3rd.hpp index cf5a0ac..cea72ee 100644 --- a/include/boost/preprocessor/repeat_from_to_3rd.hpp +++ b/include/boost/preprocessor/repeat_from_to_3rd.hpp @@ -18,6 +18,6 @@ #include /**

    Same as BOOST_PP_REPEAT_FROM_TO(), but implemented independently.

    */ -#define BOOST_PP_REPEAT_FROM_TO_3RD(S,E,M,P) BOOST_PP_REPEAT_3RD(BOOST_PP_SUB(E,S),BOOST_PP_REPEAT_FROM_TO_3RD_F,(S,M,P)) +#define BOOST_PP_REPEAT_FROM_TO_3RD(FIRST,LAST,MACRO,DATA) BOOST_PP_REPEAT_3RD(BOOST_PP_SUB(LAST,FIRST),BOOST_PP_REPEAT_FROM_TO_3RD_F,(FIRST,MACRO,DATA)) #define BOOST_PP_REPEAT_FROM_TO_3RD_F(I,SMP) BOOST_PP_TUPLE_ELEM(3,1,SMP)(BOOST_PP_ADD(I,BOOST_PP_TUPLE_ELEM(3,0,SMP)),BOOST_PP_TUPLE_ELEM(3,2,SMP)) #endif diff --git a/include/boost/preprocessor/tuple/eat.hpp b/include/boost/preprocessor/tuple/eat.hpp index 3a65bda..ea56346 100644 --- a/include/boost/preprocessor/tuple/eat.hpp +++ b/include/boost/preprocessor/tuple/eat.hpp @@ -13,7 +13,7 @@ * See http://www.boost.org for most recent version. */ -/**

    Expands to a macro that eats a tuple of the specified length.

    +/**

    Expands to a macro that eats a tuple of the specified size.

    BOOST_PP_TUPLE_EAT() is designed to be used with BOOST_PP_IF() like BOOST_PP_EMPTY().

    @@ -26,7 +26,7 @@ BOOST_PP_EMPTY().

    expands to nothing.

    */ -#define BOOST_PP_TUPLE_EAT(N) BOOST_PP_TUPLE_EAT_DELAY(N) +#define BOOST_PP_TUPLE_EAT(SIZE_OF_TUPLE) BOOST_PP_TUPLE_EAT_DELAY(SIZE_OF_TUPLE) #define BOOST_PP_TUPLE_EAT_DELAY(N) BOOST_PP_TUPLE##N##_EAT #define BOOST_PP_TUPLE0_EAT() diff --git a/include/boost/preprocessor/tuple/elem.hpp b/include/boost/preprocessor/tuple/elem.hpp index 02001c6..9301118 100644 --- a/include/boost/preprocessor/tuple/elem.hpp +++ b/include/boost/preprocessor/tuple/elem.hpp @@ -13,7 +13,7 @@ * See http://www.boost.org for most recent version. */ -/**

    Expands to the I:th element of an N-tuple.

    +/**

    Expands to the INDEX:th element of an SIZE_OF_TUPLE-tuple.

    For example,

    @@ -28,7 +28,7 @@
  • BOOST_PP_LIMIT_TUPLE
  • */ -#define BOOST_PP_TUPLE_ELEM(N,I,T) BOOST_PP_TUPLE_ELEM_DELAY(N,I,T) +#define BOOST_PP_TUPLE_ELEM(SIZE_OF_TUPLE,INDEX,TUPLE) BOOST_PP_TUPLE_ELEM_DELAY(SIZE_OF_TUPLE,INDEX,TUPLE) #if !defined(BOOST_NO_COMPILER_CONFIG) && defined(__MWERKS__) /* This is a workaround for a CodeWarrior PP bug. Strictly speaking diff --git a/include/boost/preprocessor/tuple/reverse.hpp b/include/boost/preprocessor/tuple/reverse.hpp index 28ec1f6..2290063 100644 --- a/include/boost/preprocessor/tuple/reverse.hpp +++ b/include/boost/preprocessor/tuple/reverse.hpp @@ -23,7 +23,7 @@

    expands to (C,B,A).

    */ -#define BOOST_PP_TUPLE_REVERSE(N,T) BOOST_PP_TUPLE_REVERSE_DELAY(N,T) +#define BOOST_PP_TUPLE_REVERSE(SIZE_OF_TUPLE,TUPLE) BOOST_PP_TUPLE_REVERSE_DELAY(SIZE_OF_TUPLE,TUPLE) #if !defined(BOOST_NO_COMPILER_CONFIG) && defined(__MWERKS__) /* This is a workaround for a CodeWarrior PP bug. Strictly speaking diff --git a/include/boost/preprocessor/tuple/to_list.hpp b/include/boost/preprocessor/tuple/to_list.hpp index da78504..1450b97 100644 --- a/include/boost/preprocessor/tuple/to_list.hpp +++ b/include/boost/preprocessor/tuple/to_list.hpp @@ -37,7 +37,7 @@
  • BOOST_PP_LIMIT_TUPLE
  • */ -#define BOOST_PP_TUPLE_TO_LIST(N,T) BOOST_PP_TUPLE_TO_LIST_DELAY(N,T) +#define BOOST_PP_TUPLE_TO_LIST(SIZE_OF_TUPLE,TUPLE) BOOST_PP_TUPLE_TO_LIST_DELAY(SIZE_OF_TUPLE,TUPLE) #if !defined(BOOST_NO_COMPILER_CONFIG) && defined(__MWERKS__) /* This is a workaround for a CodeWarrior PP bug. Strictly speaking diff --git a/include/boost/preprocessor/while.hpp b/include/boost/preprocessor/while.hpp index e4f2689..daffab0 100644 --- a/include/boost/preprocessor/while.hpp +++ b/include/boost/preprocessor/while.hpp @@ -16,22 +16,22 @@ #include #include -/**

    Iterates F(D,X) while C(D,X) is true.

    +/**

    Iterates OP(D,STATE) while PRED(D,STATE) is true.

    In other words, expands to:

    -  F(D, ... F(D, F(D,X) ) ... )
    +  OP(D, ... OP(D, OP(D,STATE) ) ... )
     
    -

    The depth of iteration is determined by C(D,X).

    +

    The depth of iteration is determined by PRED(D,STATE).

    For example,

    -  #define C(D,X) BOOST_PP_LESS_D(D,BOOST_PP_TUPLE_ELEM(2,0,X),BOOST_PP_TUPLE_ELEM(2,1,X))
    -  #define F(D,X) (BOOST_PP_INC(BOOST_PP_TUPLE_ELEM(2,0,X)),BOOST_PP_TUPLE_ELEM(2,1,X))
    -  BOOST_PP_WHILE(C,F,(0,3))
    +  #define PRED(D,STATE) BOOST_PP_LESS_D(D,BOOST_PP_TUPLE_ELEM(2,0,STATE),BOOST_PP_TUPLE_ELEM(2,1,STATE))
    +  #define OP(D,STATE) (BOOST_PP_INC(BOOST_PP_TUPLE_ELEM(2,0,STATE)),BOOST_PP_TUPLE_ELEM(2,1,STATE))
    +  BOOST_PP_WHILE(PRED,OP,(0,3))
     

    expands to:

    @@ -42,11 +42,11 @@

    Legend

      -
    • X is the current state of iteration. The state is usually a tuple.
    • -
    • C is the condition for iteration. It must expand to a decimal +
    • STATE is the current state of iteration. The state is usually a tuple.
    • +
    • PRED is the condition for iteration. It must expand to a decimal integer literal.
    • -
    • F 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.
    • +
    • OP is the iterated macro. Note that if the state is a tuple, then + OP(D,STATE) usually expands to a tuple of the same number of elements.
    • D 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 @@ -73,7 +73,7 @@
    • delay.c
    */ -#define BOOST_PP_WHILE(C,F,X) BOOST_PP_WHILE_C(C(1,X),0,X)(C,F,F(1,X)) +#define BOOST_PP_WHILE(PRED,OP,STATE) BOOST_PP_WHILE_C(PRED(1,STATE),0,STATE)(PRED,OP,OP(1,STATE)) #define BOOST_PP_WHILE_C(C,D,X) BOOST_PP_IF(C,BOOST_PP_WHILE##D,X BOOST_PP_TUPLE3_EAT) #define BOOST_PP_WHILE0(C,F,X) BOOST_PP_WHILE_C(C(2,X),1,X)(C,F,F(2,X))