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 @@
Expands to nothing if C != 0
and to MSG
if
-C == 0
.
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!
.
Expands to a comma if C != 0
and nothing if
-C == 0
.
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.
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
.
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
.
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
.
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
.
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
.
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
.
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 @@
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 @@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 @@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 @@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 @@
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 @@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 ^
.
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:
@@ -55,19 +55,19 @@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
.
Expands to the maximum tuple length supported by the library.
+Expands to the maximum tuple size supported by the library.
List constructor.
Lists are build using list constructors BOOST_PP_LIST_NIL and
@@ -79,15 +79,15 @@ and BOOST_PP_LIST
List nil constructor. Expands to 1 if the list is not nil and 0 otherwise. Expands to 1 if the list is nil and 0 otherwise. Expands to the first element of the list. The list must not be nil. For example, Expands to a list of all but the first element of the list. The list must not be nil. Catenates two lists together. For example, Can be used inside BOOST_PP_WHILE(). Expands to the Expands to the For example,
-#define BOOST_PP_LIST_IS_CONS(L)
+#define BOOST_PP_LIST_IS_CONS(LIST)
-#define BOOST_PP_LIST_IS_NIL(L)
+#define BOOST_PP_LIST_IS_NIL(LIST)
-#define BOOST_PP_LIST_FIRST(L)
+#define BOOST_PP_LIST_FIRST(LIST)
-#define BOOST_PP_LIST_REST(L)
+#define BOOST_PP_LIST_REST(LIST)
-#define BOOST_PP_LIST_APPEND(L,R)
+#define BOOST_PP_LIST_APPEND(LIST_1ST,LIST_2ND)
-#define BOOST_PP_LIST_APPEND_D(D,L,R)
+#define BOOST_PP_LIST_APPEND_D(D,LIST_1ST,LIST_2ND)
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)
- I
:th element of the list L
. The
+#define BOOST_PP_LIST_AT(LIST,INDEX)
+ INDEX
:th element of the list LIST
. The
first element is at index 0
.0
.
Can be used inside BOOST_PP_WHILE().
Catenates all elements of the list.
For example,
@@ -53,7 +53,7 @@Can be used inside BOOST_PP_WHILE().
Converts the list to a comma separated list.
For example,
@@ -48,7 +48,7 @@Can be used inside BOOST_PP_FOR().
Expands to a list containing all the elements X
of the list
-for which F(D,P,X)
is true.
PRED(D,DATA,X)
is true.
For example,
@@ -55,7 +55,7 @@ for whichF(D,P,X)
is true.
Can be used inside BOOST_PP_WHILE().
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,
@@ -59,7 +59,7 @@Can be used inside BOOST_PP_WHILE().
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)))@@ -76,7 +76,7 @@ list
L
(from the left or the start of the list).
Can be used inside BOOST_PP_WHILE().
Same as BOOST_PP_LIST_FOLD_LEFT(), but implemented independently.
Can be used inside BOOST_PP_WHILE().
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 ) ) ... ) @@ -51,7 +51,7 @@ listL
(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 @@ listL
(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 elementX
of the -cartesian product of the lists of theN
-tupleT_OF_L
.#define BOOST_PP_LIST_FOR_EACH_PRODUCT(MACRO,SIZE_OF_TUPLE,TUPLE_OF_LISTS)
+Repeats
MACRO(R,X)
for each elementX
of the +cartesian product of the lists of theSIZE_OF_TUPLE
-tupleTUPLE_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 -listL
.#define BOOST_PP_LIST_REST_N(COUNT,LIST)
+Expands to a list of all but the first
COUNT
elements of the +listLIST
.For example,
@@ -59,7 +59,7 @@ listL
.
-#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 elementX
+#define BOOST_PP_LIST_TRANSFORM(OP,DATA,LIST)
+Applies the macro
OP(D,DATA,X)
to each elementX
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)
forI = [0,N[
.#define BOOST_PP_REPEAT(COUNT,MACRO,DATA)
+Repeats the macro
MACRO(INDEX,DATA)
forINDEX = [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)
forI = [S,E[
.#define BOOST_PP_REPEAT_FROM_TO(FIRST,LAST,MACRO,DATA)
+Repeats the macro
MACRO(INDEX,DATA)
forINDEX = [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 anN
-tuple.#define BOOST_PP_TUPLE_ELEM(SIZE_OF_TUPLE,INDEX,TUPLE)
+Expands to the
INDEX
:th element of anSIZE_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)
whileC(D,X)
is true.#define BOOST_PP_WHILE(PRED,OP,STATE)
+Iterates
OP(D,STATE)
whilePRED(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
Expands to nothing if C != 0
and to MSG
if
-C == 0
.
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!
.
Obsolete. Use BOOST_PP_ASSERT_MSG().
*/ #define BOOST_PREPROCESSOR_ASSERT_MSG(C,MSG) BOOST_PP_ASSERT_MSG(C,MSG) diff --git a/include/boost/preprocessor/comma_if.hpp b/include/boost/preprocessor/comma_if.hpp index 89bfb77..6ac9861 100644 --- a/include/boost/preprocessor/comma_if.hpp +++ b/include/boost/preprocessor/comma_if.hpp @@ -17,12 +17,14 @@ #includeExpands to a comma if C != 0
and nothing if
-C == 0
.
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.
Obsolete. Use BOOST_PP_COMMA_IF().
*/ #define BOOST_PREPROCESSOR_COMMA_IF(C) BOOST_PP_COMMA_IF(C) diff --git a/include/boost/preprocessor/comparison/equal.hpp b/include/boost/preprocessor/comparison/equal.hpp index b9452b2..e7f3cef 100644 --- a/include/boost/preprocessor/comparison/equal.hpp +++ b/include/boost/preprocessor/comparison/equal.hpp @@ -19,6 +19,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
.
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
.
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
.
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
.
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
.
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
.
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))@@ -49,7 +49,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 @@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 @@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 @@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 @@
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 @@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 ^
.
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 @@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
.
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 @@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 @@ #includeExpands 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 index0
.
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 @@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 @@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 @@ #includeExpands to a list containing all the elements X
of the list
-for which F(D,P,X)
is true.
PRED(D,DATA,X)
is true.
For example,
@@ -41,10 +41,10 @@ for whichF(D,P,X)
is true.
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 @@ #includeExpands 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 @@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 @@ #includeIterates 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).
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 @@ #includeSame 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 @@ #includeIterates 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 @@ listL
(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 @@ listL
(from the right or the end of the list).
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 @@ #includeSame 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 @@ #includeRepeats 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)[.
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 @@ #includeRepeats 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)[.
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 @@ #includeRepeats 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.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 @@ #includeExpands 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 @@ listL
.
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 @@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 @@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 @@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 @@ #includeApplies 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.
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.
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 @@ #includeRepeats 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 @@
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 @@ #includeSame 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 @@expands to (C,B,A)
.
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 @@