diff --git a/doc/keywords.txt b/doc/keywords.txt index 872a0b7..df655d9 100644 --- a/doc/keywords.txt +++ b/doc/keywords.txt @@ -27,6 +27,26 @@ BOOST_PP_LESS_EQUAL BOOST_PP_LIMIT_DIM BOOST_PP_LIMIT_MAG BOOST_PP_LIMIT_TUPLE +BOOST_PP_LIST_APPEND +BOOST_PP_LIST_AT +BOOST_PP_LIST_CAT +BOOST_PP_LIST_CONS +BOOST_PP_LIST_ENUM +BOOST_PP_LIST_FILTER +BOOST_PP_LIST_FIRST +BOOST_PP_LIST_FIRST_N +BOOST_PP_LIST_FOLD_LEFT +BOOST_PP_LIST_FOLD_RIGHT +BOOST_PP_LIST_FOR_EACH +BOOST_PP_LIST_IS_CONS +BOOST_PP_LIST_IS_NIL +BOOST_PP_LIST_NIL +BOOST_PP_LIST_REST +BOOST_PP_LIST_REST_N +BOOST_PP_LIST_REVERSE +BOOST_PP_LIST_SIZE +BOOST_PP_LIST_TO_TUPLE +BOOST_PP_LIST_TRANSFORM BOOST_PP_MAX BOOST_PP_MIN BOOST_PP_MOD @@ -42,5 +62,6 @@ BOOST_PP_STRINGIZE BOOST_PP_SUB BOOST_PP_TUPLE_EAT BOOST_PP_TUPLE_ELEM +BOOST_PP_TUPLE_TO_LIST BOOST_PP_WHILE BOOST_PP_XOR diff --git a/doc/plan.txt b/doc/plan.txt index c5ac5aa..b516015 100644 --- a/doc/plan.txt +++ b/doc/plan.txt @@ -3,6 +3,5 @@ please e-mail such suggestions to boost@yahoogroups.com, but also cc them to vesa_karvonen@hotmail.com. Current R&D: -- Data structures (cons list) - Faster preprocessing - Faster arithmetic diff --git a/doc/reference/adt_8hpp.html b/doc/reference/adt_8hpp.html new file mode 100644 index 0000000..9e15a37 --- /dev/null +++ b/doc/reference/adt_8hpp.html @@ -0,0 +1,244 @@ +c++boost.gif (8819 bytes) +
+ +
+Main Page   File List   File Members  
+

adt.hpp File Reference

+ + + + + + + + + + + + + +

Defines

#define BOOST_PP_LIST_CONS(H, T)
 List constructor. More...

#define BOOST_PP_LIST_NIL
 List nil constructor. More...

#define BOOST_PP_LIST_IS_CONS(L)
 Expands to 1 if the list is not nil and 0 otherwise. More...

#define BOOST_PP_LIST_IS_NIL(L)
 Expands to 1 if the list is nil and 0 otherwise. More...

#define BOOST_PP_LIST_FIRST(L)
 Expands to the first element of the list. The list must not be nil. More...

#define BOOST_PP_LIST_REST(L)
 Expands to a list of all but the first element of the list. The list must not be nil. More...

+

Detailed Description

+ Click here to see the header. +

+This header defines the fundamental list operations. +

+NOTE: The internal representation of lists is hidden. Although there aren't compelling reasons to change the representation, you should avoid writing code that depends on the internal representation details. +

+


Define Documentation

+

+ + + + +
+ + + + + + + + + + +
#define BOOST_PP_LIST_CONSH,
  +
+
+ + + + + +
+   + + +

+List constructor. +

+Lists are build using list constructors BOOST_PP_LIST_NIL and BOOST_PP_LIST_CONS(). For example, +

+

+  BOOST_PP_LIST_CONS(1,
+  BOOST_PP_LIST_CONS(2,
+  BOOST_PP_LIST_CONS(3,
+  BOOST_PP_LIST_CONS(4,
+  BOOST_PP_LIST_CONS(5,
+  BOOST_PP_LIST_NIL)))))
+
+

+Short lists can also be build from tuples: +

+

+  BOOST_PP_TUPLE_TO_LIST(5,(1,2,3,4,5))
+
+

+Both of the above lists contain 5 elements: 1, 2, 3, 4 and 5.

+

+ + + + +
+ + + + + + + +
#define BOOST_PP_LIST_FIRST  +
+
+ + + + + +
+   + + +

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

+For example, +

+

+  BOOST_PP_LIST_FIRST(BOOST_PP_TUPLE_TO_LIST(5,(1,2,3,4,5)))
+
+

+expands to 1. +

+See BOOST_PP_LIST_REST().

+

+ + + + +
+ + + + + + + +
#define BOOST_PP_LIST_IS_CONS  +
+
+ + + + + +
+   + + +

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

+See BOOST_PP_LIST_IS_NIL().

+

+ + + + +
+ + + + + + + +
#define BOOST_PP_LIST_IS_NIL  +
+
+ + + + + +
+   + + +

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

+See BOOST_PP_LIST_IS_CONS().

+

+ + + + +
+ + +
#define BOOST_PP_LIST_NIL +
+
+ + + + + +
+   + + +

+List nil constructor. +

+See BOOST_PP_LIST_CONS().

+

+ + + + +
+ + + + + + + +
#define BOOST_PP_LIST_REST  +
+
+ + + + + +
+   + + +

+Expands to a list of all but the first element of the list. The list must not be nil. +

+For example, +

+

+  BOOST_PP_LIST_REST(BOOST_PP_TUPLE_TO_LIST(5,(1,2,3,4,5)))
+
+

+expands to a list containing 2, 3, 4 and 5. +

+See BOOST_PP_LIST_FIRST().

+


+

© Copyright Housemarque Oy 2001

+

Permission to copy, use, modify, sell and distribute this document is granted + provided this copyright notice appears in all copies. This document is provided + "as is" without express or implied warranty, and with no claim as to its suitability + for any purpose.

+ +

Generated:

diff --git a/doc/reference/append_8hpp.html b/doc/reference/append_8hpp.html new file mode 100644 index 0000000..950a29f --- /dev/null +++ b/doc/reference/append_8hpp.html @@ -0,0 +1,66 @@ +c++boost.gif (8819 bytes) +
+ +
+Main Page   File List   File Members  
+

append.hpp File Reference

+ + + +

Defines

#define BOOST_PP_LIST_APPEND(L, P)
 Catenates two lists together. More...

+

Detailed Description

+ Click here to see the header. +

+


Define Documentation

+

+ + + + +
+ + + + + + + + + + +
#define BOOST_PP_LIST_APPENDL,
  +
+
+ + + + + +
+   + + +

+Catenates two lists together. +

+For example, +

+

+  BOOST_PP_LIST_APPEND
+  ( BOOST_PP_TUPLE_TO_LIST(2,(1,2))
+  , BOOST_PP_TUPLE_TO_LIST(2,(3,4))
+  )
+
+

+produces a list containing 1, 2, 3 and 4.

+


+

© Copyright Housemarque Oy 2001

+

Permission to copy, use, modify, sell and distribute this document is granted + provided this copyright notice appears in all copies. This document is provided + "as is" without express or implied warranty, and with no claim as to its suitability + for any purpose.

+ +

Generated:

diff --git a/doc/reference/at_8hpp.html b/doc/reference/at_8hpp.html new file mode 100644 index 0000000..dd2935c --- /dev/null +++ b/doc/reference/at_8hpp.html @@ -0,0 +1,63 @@ +c++boost.gif (8819 bytes) +
+ +
+Main Page   File List   File Members  
+

at.hpp File Reference

+ + + +

Defines

#define BOOST_PP_LIST_AT(L, I)
 Expands to the I:th element of the list L. The first element is at index 0. More...

+

Detailed Description

+ Click here to see the header. +

+


Define Documentation

+

+ + + + +
+ + + + + + + + + + +
#define BOOST_PP_LIST_ATL,
  +
+
+ + + + + +
+   + + +

+Expands to the I:th element of the list L. The first element is at index 0. +

+For example, +

+

+  BOOST_PP_LIST_AT(BOOST_PP_TUPLE_TO_LIST(3,(A,B,C)),1)
+
+

+expands to B.

+


+

© Copyright Housemarque Oy 2001

+

Permission to copy, use, modify, sell and distribute this document is granted + provided this copyright notice appears in all copies. This document is provided + "as is" without express or implied warranty, and with no claim as to its suitability + for any purpose.

+ +

Generated:

diff --git a/doc/reference/cat_8hpp.html b/doc/reference/cat_8hpp.html index 4265020..49d4ab7 100644 --- a/doc/reference/cat_8hpp.html +++ b/doc/reference/cat_8hpp.html @@ -46,7 +46,7 @@

Delays the catenation of L and R.

-Example: +For example,

   #define STATIC_ASSERT(EXPR)\
@@ -63,7 +63,7 @@ Example:
   STATIC_ASSERT(sizeof(int) <= sizeof(long));
 

-The above expands to: +expands to:

   enum
diff --git a/doc/reference/eat_8hpp.html b/doc/reference/eat_8hpp.html
index aa6998d..6a8436e 100644
--- a/doc/reference/eat_8hpp.html
+++ b/doc/reference/eat_8hpp.html
@@ -43,13 +43,13 @@ Expands to a macro that eats a tuple of the specified length.
 

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

-For example: +For example,

   BOOST_PP_IF(0,BOOST_PP_ENUM_PARAMS,BOOST_PP_TUPLE_EAT(2))(10,P)
 

-The above expands to nothing. +expands to nothing.


diff --git a/doc/reference/elem_8hpp.html b/doc/reference/elem_8hpp.html index d295a36..de8ad10 100644 --- a/doc/reference/elem_8hpp.html +++ b/doc/reference/elem_8hpp.html @@ -49,6 +49,14 @@

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

+For example, +

+

+  BOOST_PP_TUPLE_ELEM(2,1,(A,B))
+
+

+expands to B. +

Tuples can be used for representing structured data.

Examples of tuples: @@ -59,15 +67,7 @@ Examples of tuples: 4-tuple: (A B C, D, EF, 34)

-Example: -

-

-  BOOST_PP_TUPLE_ELEM(2,1,(A,B))
-
-

-The above expands to B. -

-See also BOOST_PP_LIMIT_TUPLE. +See BOOST_PP_LIMIT_TUPLE.

diff --git a/doc/reference/files.html b/doc/reference/files.html index 30524e5..3d9323d 100644 --- a/doc/reference/files.html +++ b/doc/reference/files.html @@ -8,11 +8,15 @@ Main Page   File List   File Members  


Boost PREPROCESSOR library: Reference File List

Here is a list of all files with brief descriptions: + + + + @@ -22,6 +26,7 @@ + @@ -29,7 +34,12 @@ + + + + + @@ -38,6 +48,7 @@ + @@ -51,8 +62,14 @@ + + + + + + diff --git a/doc/reference/filter_8hpp.html b/doc/reference/filter_8hpp.html new file mode 100644 index 0000000..2c2fc0a --- /dev/null +++ b/doc/reference/filter_8hpp.html @@ -0,0 +1,66 @@ +c++boost.gif (8819 bytes) +
+ +
+Main Page   File List   File Members  
+

filter.hpp File Reference

add.hpp
adt.hpp
and.hpp
append.hpp
arithmetic.hpp
assert_msg.hpp
at.hpp
bool.hpp
cat.hpp
list/cat.hpp
comma.hpp
comma_if.hpp
comparison.hpp
elem.hpp
empty.hpp
enum.hpp
list/enum.hpp
enum_params.hpp
enum_params_with_a_default.hpp
enum_params_with_defaults.hpp
enum_shifted_params.hpp
equal.hpp
expand.hpp
filter.hpp
first_n.hpp
fold_left.hpp
fold_right.hpp
for.hpp
for_each.hpp
greater.hpp
greater_equal.hpp
identity.hpp
less.hpp
less_equal.hpp
limits.hpp
list.hpp
logical.hpp
max.hpp
min.hpp
repeat.hpp
repeat_2nd.hpp
repeat_3rd.hpp
rest_n.hpp
reverse.hpp
size.hpp
stringize.hpp
sub.hpp
to_list.hpp
to_tuple.hpp
transform.hpp
tuple.hpp
while.hpp
xor.hpp
+ + + +

Defines

#define BOOST_PP_LIST_FILTER(F, P, L)
 Expands to a list containing all the elements X of the list for which F(D,P,X) is true. More...

+

Detailed Description

+ Click here to see the header. +

+


Define Documentation

+

+ + + + +
+ + + + + + + + + + + + + +
#define BOOST_PP_LIST_FILTERF,
P,
  +
+
+ + + + + +
+   + + +

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

+For example, +

+

+  BOOST_PP_LIST_FILTER(BOOST_PP_NOT_EQUAL_D,2,BOOST_PP_TUPLE_TO_LIST(3,(1,2,3)))
+
+

+expands to a list containing 1 and 3.

+


+

© Copyright Housemarque Oy 2001

+

Permission to copy, use, modify, sell and distribute this document is granted + provided this copyright notice appears in all copies. This document is provided + "as is" without express or implied warranty, and with no claim as to its suitability + for any purpose.

+ +

Generated:

diff --git a/doc/reference/first__n_8hpp.html b/doc/reference/first__n_8hpp.html new file mode 100644 index 0000000..5f01895 --- /dev/null +++ b/doc/reference/first__n_8hpp.html @@ -0,0 +1,63 @@ +c++boost.gif (8819 bytes) +
+ +
+Main Page   File List   File Members  
+

first_n.hpp File Reference

+ + + +

Defines

#define BOOST_PP_LIST_FIRST_N(N, L)
 Expands to a list of the first N elements of the list. More...

+

Detailed Description

+ Click here to see the header. +

+


Define Documentation

+

+ + + + +
+ + + + + + + + + + +
#define BOOST_PP_LIST_FIRST_NN,
  +
+
+ + + + + +
+   + + +

+Expands to a list of the first N elements of the list. +

+For example, +

+

+  BOOST_PP_LIST_FIRST_N(2,BOOST_PP_TUPLE_TO_LIST(4,(+,-,*,/)))
+
+

+expands to a list containing + and -.

+


+

© Copyright Housemarque Oy 2001

+

Permission to copy, use, modify, sell and distribute this document is granted + provided this copyright notice appears in all copies. This document is provided + "as is" without express or implied warranty, and with no claim as to its suitability + for any purpose.

+ +

Generated:

diff --git a/doc/reference/fold__left_8hpp.html b/doc/reference/fold__left_8hpp.html new file mode 100644 index 0000000..6f30eb3 --- /dev/null +++ b/doc/reference/fold__left_8hpp.html @@ -0,0 +1,78 @@ +c++boost.gif (8819 bytes) +
+ +
+Main Page   File List   File Members  
+

fold_left.hpp File Reference

+ + + +

Defines

#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). More...

+

Detailed Description

+ Click here to see the header. +

+


Define Documentation

+

+ + + + +
+ + + + + + + + + + + + + +
#define BOOST_PP_LIST_FOLD_LEFTF,
P,
  +
+
+ + + + + +
+   + + +

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

+In other words, +

+

+  BOOST_PP_LIST_FOLD_LEFT(F,P,L)
+
+

+expands to: +

+

+  F
+  ( 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))
+  )
+
+

+Note that folding, or accumulation, is a very general pattern of computation. Most list operations can implemented in terms of folding. +

+See BOOST_PP_LIST_FOLD_RIGHT().

+


+

© Copyright Housemarque Oy 2001

+

Permission to copy, use, modify, sell and distribute this document is granted + provided this copyright notice appears in all copies. This document is provided + "as is" without express or implied warranty, and with no claim as to its suitability + for any purpose.

+ +

Generated:

diff --git a/doc/reference/fold__right_8hpp.html b/doc/reference/fold__right_8hpp.html new file mode 100644 index 0000000..d8c817a --- /dev/null +++ b/doc/reference/fold__right_8hpp.html @@ -0,0 +1,84 @@ +c++boost.gif (8819 bytes) +
+ +
+Main Page   File List   File Members  
+

fold_right.hpp File Reference

+ + + +

Defines

#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). More...

+

Detailed Description

+ Click here to see the header. +

+


Define Documentation

+

+ + + + +
+ + + + + + + + + + + + + +
#define BOOST_PP_LIST_FOLD_RIGHTF,
L,
  +
+
+ + + + + +
+   + + +

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

+In other words, +

+

+  BOOST_PP_LIST_FOLD_RIGHT(F,L,P)
+
+

+expands to: +

+

+  F
+  ( D
+  , BOOST_PP_LIST_AT(L,0)
+  , ... F
+        ( D
+        , BOOST_PP_LIST_AT(L,BOOST_PP_SUB(BOOST_PP_LIST_SIZE(L),2))
+        , F
+          ( D
+          , BOOST_PP_LIST_AT(L,BOOST_PP_SUB(BOOST_PP_LIST_SIZE(L),1))
+          , P
+          )
+        ) ...
+  )
+
+

+See BOOST_PP_LIST_FOLD_LEFT().

+


+

© Copyright Housemarque Oy 2001

+

Permission to copy, use, modify, sell and distribute this document is granted + provided this copyright notice appears in all copies. This document is provided + "as is" without express or implied warranty, and with no claim as to its suitability + for any purpose.

+ +

Generated:

diff --git a/doc/reference/for_8hpp.html b/doc/reference/for_8hpp.html index 19c1bb1..d3b56ce 100644 --- a/doc/reference/for_8hpp.html +++ b/doc/reference/for_8hpp.html @@ -69,7 +69,17 @@ The length of the sequence is determined by C(R,X).

I is the state instantiation macro.

-R is the recursion depth and should only be used as a parameter to other macros implemented using BOOST_PP_FOR() or for invoking BOOST_PP_FOR#R() directly. For each macro implemented 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/C++ preprocessor. +R is the recursion depth and should only be used as a parameter to other macros implemented using BOOST_PP_FOR() or for invoking BOOST_PP_FOR#R() directly. For each macro implemented 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. +

+

BOOST_PP_REPEAT() vs BOOST_PP_FOR()

+ +

+BOOST_PP_FOR() is a generalization of BOOST_PP_REPEAT(). This means that BOOST_PP_REPEAT() can be implemented using BOOST_PP_FOR(). Unfortunately, BOOST_PP_FOR() is slower than BOOST_PP_REPEAT(). In addition, BOOST_PP_REPEAT() was introduced earlier, is generally easier to use, and is still quite useful on its own. +

+

2D and 3D repetition

+ +

+BOOST_PP_FOR() can be used for multidimensional repetition simply by invoking BOOST_PP_FOR#R() directly.


diff --git a/doc/reference/for__each_8hpp.html b/doc/reference/for__each_8hpp.html new file mode 100644 index 0000000..644c1ba --- /dev/null +++ b/doc/reference/for__each_8hpp.html @@ -0,0 +1,69 @@ +c++boost.gif (8819 bytes) +
+ +
+Main Page   File List   File Members  
+

for_each.hpp File Reference

+ + + +

Defines

#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)[. More...

+

Detailed Description

+ Click here to see the header. +

+


Define Documentation

+

+ + + + +
+ + + + + + + + + + + + + +
#define BOOST_PP_LIST_FOR_EACHF,
P,
  +
+
+ + + + + +
+   + + +

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

+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))
+  ...
+  F(R,P,BOOST_PP_LIST_AT(L,BOOST_PP_DEC(BOOST_PP_LIST_SIZE(L))))
+
+

+See BOOST_PP_FOR() for an explanation of the R parameter.

+


+

© Copyright Housemarque Oy 2001

+

Permission to copy, use, modify, sell and distribute this document is granted + provided this copyright notice appears in all copies. This document is provided + "as is" without express or implied warranty, and with no claim as to its suitability + for any purpose.

+ +

Generated:

diff --git a/doc/reference/globals.html b/doc/reference/globals.html index 50c7e5f..2607eea 100644 --- a/doc/reference/globals.html +++ b/doc/reference/globals.html @@ -36,7 +36,27 @@ : less_equal.hpp
  • BOOST_PP_LIMIT_DIM : limits.hpp
  • BOOST_PP_LIMIT_MAG : limits.hpp
  • BOOST_PP_LIMIT_TUPLE -: limits.hpp
  • BOOST_PP_MAX +: limits.hpp
  • BOOST_PP_LIST_APPEND +: append.hpp
  • BOOST_PP_LIST_AT +: at.hpp
  • BOOST_PP_LIST_CAT +: list/cat.hpp
  • BOOST_PP_LIST_CONS +: adt.hpp
  • BOOST_PP_LIST_ENUM +: list/enum.hpp
  • BOOST_PP_LIST_FILTER +: filter.hpp
  • BOOST_PP_LIST_FIRST +: adt.hpp
  • BOOST_PP_LIST_FIRST_N +: first_n.hpp
  • BOOST_PP_LIST_FOLD_LEFT +: fold_left.hpp
  • BOOST_PP_LIST_FOLD_RIGHT +: fold_right.hpp
  • BOOST_PP_LIST_FOR_EACH +: for_each.hpp
  • BOOST_PP_LIST_IS_CONS +: adt.hpp
  • BOOST_PP_LIST_IS_NIL +: adt.hpp
  • BOOST_PP_LIST_NIL +: adt.hpp
  • BOOST_PP_LIST_REST +: adt.hpp
  • BOOST_PP_LIST_REST_N +: rest_n.hpp
  • BOOST_PP_LIST_REVERSE +: reverse.hpp
  • BOOST_PP_LIST_SIZE +: size.hpp
  • BOOST_PP_LIST_TO_TUPLE +: to_tuple.hpp
  • BOOST_PP_LIST_TRANSFORM +: transform.hpp
  • BOOST_PP_MAX : max.hpp
  • BOOST_PP_MIN : min.hpp
  • BOOST_PP_MOD : mod.hpp
  • BOOST_PP_MUL @@ -51,7 +71,8 @@ : stringize.hpp
  • BOOST_PP_SUB : sub.hpp
  • BOOST_PP_TUPLE_EAT : eat.hpp
  • BOOST_PP_TUPLE_ELEM -: elem.hpp
  • BOOST_PP_WHILE +: elem.hpp
  • BOOST_PP_TUPLE_TO_LIST +: to_list.hpp
  • BOOST_PP_WHILE : while.hpp
  • BOOST_PP_XOR : xor.hpp
  • BOOST_PREPROCESSOR_ADD : add.hpp
  • BOOST_PREPROCESSOR_AND diff --git a/doc/reference/identity_8hpp.html b/doc/reference/identity_8hpp.html index 5ee6a83..1e4b6a8 100644 --- a/doc/reference/identity_8hpp.html +++ b/doc/reference/identity_8hpp.html @@ -45,14 +45,14 @@ Expands to X once invoked.

    Designed to be used with BOOST_PP_IF(), when one of the clauses need to be invoked.

    -Example: +For example,

       BOOST_PP_IDENTITY(X)()
       //                  ^^ NOTE!
     

    -The above expands to: +expands to:

       X
    diff --git a/doc/reference/list_2cat_8hpp.html b/doc/reference/list_2cat_8hpp.html
    new file mode 100644
    index 0000000..bf5f33f
    --- /dev/null
    +++ b/doc/reference/list_2cat_8hpp.html
    @@ -0,0 +1,60 @@
    +c++boost.gif (8819 bytes)
    +
    + +
    +Main Page   File List   File Members  
    +

    cat.hpp File Reference

    + + + +

    Defines

    #define BOOST_PP_LIST_CAT(L)
     Catenates all elements of the list. More...

    +

    Detailed Description

    + Click here to see the header. +

    +


    Define Documentation

    +

    + + + + +
    + + + + + + + +
    #define BOOST_PP_LIST_CAT  +
    +
    + + + + + +
    +   + + +

    +Catenates all elements of the list. +

    +For example, +

    +

    +  BOOST_PP_LIST_CAT(BOOST_PP_TUPLE_TO_LIST(3,(1,2,3)))
    +
    +

    +expands to 123.

    +


    +

    © Copyright Housemarque Oy 2001

    +

    Permission to copy, use, modify, sell and distribute this document is granted + provided this copyright notice appears in all copies. This document is provided + "as is" without express or implied warranty, and with no claim as to its suitability + for any purpose.

    + +

    Generated:

    diff --git a/doc/reference/list_2enum_8hpp.html b/doc/reference/list_2enum_8hpp.html new file mode 100644 index 0000000..9fa8c4f --- /dev/null +++ b/doc/reference/list_2enum_8hpp.html @@ -0,0 +1,64 @@ +c++boost.gif (8819 bytes) +
    + +
    +Main Page   File List   File Members  
    +

    enum.hpp File Reference

    + + + +

    Defines

    #define BOOST_PP_LIST_ENUM(L)
     Converts the list to a comma separated list. More...

    +

    Detailed Description

    + Click here to see the header. +

    +


    Define Documentation

    +

    + + + + +
    + + + + + + + +
    #define BOOST_PP_LIST_ENUM  +
    +
    + + + + + +
    +   + + +

    +Converts the list to a comma separated list. +

    +For example, +

    +

    +  BOOST_PP_LIST_ENUM(BOOST_PP_TUPLE_TO_LIST(3,(A,B,C)))
    +
    +

    +expands to: +

    +

    +  A, B, C
    +
    +


    +

    © Copyright Housemarque Oy 2001

    +

    Permission to copy, use, modify, sell and distribute this document is granted + provided this copyright notice appears in all copies. This document is provided + "as is" without express or implied warranty, and with no claim as to its suitability + for any purpose.

    + +

    Generated:

    diff --git a/doc/reference/list_8hpp.html b/doc/reference/list_8hpp.html new file mode 100644 index 0000000..4b5595f --- /dev/null +++ b/doc/reference/list_8hpp.html @@ -0,0 +1,23 @@ +c++boost.gif (8819 bytes) +
    + +
    +Main Page   File List   File Members  
    +

    list.hpp File Reference

    +
    +

    Detailed Description

    + Click here to see the header. +

    +Includes all list headers. +

    +


    +

    © Copyright Housemarque Oy 2001

    +

    Permission to copy, use, modify, sell and distribute this document is granted + provided this copyright notice appears in all copies. This document is provided + "as is" without express or implied warranty, and with no claim as to its suitability + for any purpose.

    + +

    Generated:

    diff --git a/doc/reference/repeat_8hpp.html b/doc/reference/repeat_8hpp.html index 014c972..7b10bd1 100644 --- a/doc/reference/repeat_8hpp.html +++ b/doc/reference/repeat_8hpp.html @@ -55,7 +55,59 @@ In other words, expands to the sequence: M(0,P) M(1,P) ... M(N-1,P)

    -See BOOST_PP_LIMIT_MAG. +See BOOST_PP_LIMIT_MAG. +

    +

    2D and 3D repetition

    + +

    +2D and 3D repetition are supported with the BOOST_PP_REPEAT_2ND() and BOOST_PP_REPEAT_3RD() macros. For example, +

    +

    +  // A generalized macro for generating 2D arrays
    +  #define ARRAY_2D(W,H,M,P)\
    +    BOOST_PP_REPEAT_2ND\
    +    ( H\
    +    , ARRAY_2D_ROW\
    +    , (W,H,M,P)\
    +    )
    +  #define ARRAY_2D_ROW(Y,WHMP)\
    +    BOOST_PP_EXPAND\
    +    ( BOOST_PP_REPEAT\
    +      ( BOOST_PP_TUPLE_ELEM(4,0,WHMP)\
    +      , ARRAY_2D_ELEM\
    +      , (Y,BOOST_PP_TUPLE4_ENUM WHMP)\
    +      )\
    +    )
    +  #define BOOST_PP_TUPLE4_ENUM(A,B,C,D) A,B,C,D
    +  #define ARRAY_2D_ELEM(X,YWHMP)\
    +    BOOST_PP_TUPLE_ELEM(5,3,YWHMP)\
    +    BOOST_PP_EXPAND\
    +    ( ( X\
    +      , BOOST_PP_TUPLE_ELEM(5,0,YWHMP)\
    +      , BOOST_PP_TUPLE_ELEM(5,1,YWHMP)\
    +      , BOOST_PP_TUPLE_ELEM(5,2,YWHMP)\
    +      , BOOST_PP_TUPLE_ELEM(5,4,YWHMP)\
    +      )\
    +    )
    +
    +  // Here we use the above macro to generate something
    +  #define ELEM(X,Y,W,H,E) BOOST_PP_COMMA_IF(BOOST_PP_OR(X,Y)) E##_##X##_##Y
    +
    +  ARRAY_2D(3,4,ELEM,elem)
    +
    +

    +expands to: +

    +

    +  elem_0_0, elem_1_0, elem_2_0,
    +  elem_0_1, elem_1_1, elem_2_1,
    +  elem_0_2, elem_1_2, elem_2_2,
    +  elem_0_3, elem_1_3, elem_2_3
    +
    +

    +Since recursive expansion of macros is not allowed by the C++ preprocessor, replacing the BOOST_PP_REPEAT_2ND above with BOOST_PP_REPEAT, would not produce the above expansion. +

    +See BOOST_PP_FOR().

    diff --git a/doc/reference/rest__n_8hpp.html b/doc/reference/rest__n_8hpp.html new file mode 100644 index 0000000..6b962ae --- /dev/null +++ b/doc/reference/rest__n_8hpp.html @@ -0,0 +1,63 @@ +c++boost.gif (8819 bytes) +


    + +
    +Main Page   File List   File Members  
    +

    rest_n.hpp File Reference

    + + + +

    Defines

    #define BOOST_PP_LIST_REST_N(N, L)
     Expands to a list of all but the first N elements of the list. More...

    +

    Detailed Description

    + Click here to see the header. +

    +


    Define Documentation

    +

    + + + + +
    + + + + + + + + + + +
    #define BOOST_PP_LIST_REST_NN,
      +
    +
    + + + + + +
    +   + + +

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

    +For example, +

    +

    +  BOOST_PP_LIST_REST_N(2,BOOST_PP_TUPLE_TO_LIST(4,(+,-,*,/)))
    +
    +

    +expands to a list containing * and /.

    +


    +

    © Copyright Housemarque Oy 2001

    +

    Permission to copy, use, modify, sell and distribute this document is granted + provided this copyright notice appears in all copies. This document is provided + "as is" without express or implied warranty, and with no claim as to its suitability + for any purpose.

    + +

    Generated:

    diff --git a/doc/reference/reverse_8hpp.html b/doc/reference/reverse_8hpp.html new file mode 100644 index 0000000..2f6e383 --- /dev/null +++ b/doc/reference/reverse_8hpp.html @@ -0,0 +1,60 @@ +c++boost.gif (8819 bytes) +
    + +
    +Main Page   File List   File Members  
    +

    reverse.hpp File Reference

    + + + +

    Defines

    #define BOOST_PP_LIST_REVERSE(L)
     List reversal. More...

    +

    Detailed Description

    + Click here to see the header. +

    +


    Define Documentation

    +

    + + + + +
    + + + + + + + +
    #define BOOST_PP_LIST_REVERSE  +
    +
    + + + + + +
    +   + + +

    +List reversal. +

    +For example, +

    +

    +  BOOST_PP_LIST_REVERSE(BOOST_PP_TUPLE_TO_LIST(3,(A,B,C)))
    +
    +

    +expands to a list containing C, B and A.

    +


    +

    © Copyright Housemarque Oy 2001

    +

    Permission to copy, use, modify, sell and distribute this document is granted + provided this copyright notice appears in all copies. This document is provided + "as is" without express or implied warranty, and with no claim as to its suitability + for any purpose.

    + +

    Generated:

    diff --git a/doc/reference/size_8hpp.html b/doc/reference/size_8hpp.html new file mode 100644 index 0000000..b046317 --- /dev/null +++ b/doc/reference/size_8hpp.html @@ -0,0 +1,60 @@ +c++boost.gif (8819 bytes) +
    + +
    +Main Page   File List   File Members  
    +

    size.hpp File Reference

    + + + +

    Defines

    #define BOOST_PP_LIST_SIZE(L)
     Expands to the number of elements in the list. More...

    +

    Detailed Description

    + Click here to see the header. +

    +


    Define Documentation

    +

    + + + + +
    + + + + + + + +
    #define BOOST_PP_LIST_SIZE  +
    +
    + + + + + +
    +   + + +

    +Expands to the number of elements in the list. +

    +For example, +

    +

    +  BOOST_PP_LIST_SIZE(BOOST_PP_TUPLE_TO_LIST(3,(A,B,C)))
    +
    +

    +expands to 3.

    +


    +

    © Copyright Housemarque Oy 2001

    +

    Permission to copy, use, modify, sell and distribute this document is granted + provided this copyright notice appears in all copies. This document is provided + "as is" without express or implied warranty, and with no claim as to its suitability + for any purpose.

    + +

    Generated:

    diff --git a/doc/reference/stringize_8hpp.html b/doc/reference/stringize_8hpp.html index 0208018..3727a26 100644 --- a/doc/reference/stringize_8hpp.html +++ b/doc/reference/stringize_8hpp.html @@ -43,7 +43,7 @@

    Delays the stringization of E.

    -Example: +For example,

     #define NOTE(STR)\
    @@ -54,7 +54,7 @@ Example:
     #pragma NOTE("TBD!")
     

    -The above expands to: +expands to:

       #pragma message("examples.cpp" "(" "20" ") : " "TBD!")
    diff --git a/doc/reference/to__list_8hpp.html b/doc/reference/to__list_8hpp.html
    new file mode 100644
    index 0000000..d9804c3
    --- /dev/null
    +++ b/doc/reference/to__list_8hpp.html
    @@ -0,0 +1,59 @@
    +c++boost.gif (8819 bytes)
    +
    + +
    +Main Page   File List   File Members  
    +

    to_list.hpp File Reference

    + + + +

    Defines

    #define BOOST_PP_TUPLE_TO_LIST(N, T)
     Converts a tuple to a list. More...

    +

    Detailed Description

    + Click here to see the header. +

    +


    Define Documentation

    +

    + + + + +
    + + + + + + + + + + +
    #define BOOST_PP_TUPLE_TO_LISTN,
      +
    +
    + + + + + +
    +   + + +

    +Converts a tuple to a list. +

    +See BOOST_PP_LIST_CONS() for an example. +

    +See BOOST_PP_LIMIT_TUPLE.

    +


    +

    © Copyright Housemarque Oy 2001

    +

    Permission to copy, use, modify, sell and distribute this document is granted + provided this copyright notice appears in all copies. This document is provided + "as is" without express or implied warranty, and with no claim as to its suitability + for any purpose.

    + +

    Generated:

    diff --git a/doc/reference/to__tuple_8hpp.html b/doc/reference/to__tuple_8hpp.html new file mode 100644 index 0000000..93b708d --- /dev/null +++ b/doc/reference/to__tuple_8hpp.html @@ -0,0 +1,62 @@ +c++boost.gif (8819 bytes) +
    + +
    +Main Page   File List   File Members  
    +

    to_tuple.hpp File Reference

    + + + +

    Defines

    #define BOOST_PP_LIST_TO_TUPLE(L)
     Converts the list to a tuple. More...

    +

    Detailed Description

    + Click here to see the header. +

    +


    Define Documentation

    +

    + + + + +
    + + + + + + + +
    #define BOOST_PP_LIST_TO_TUPLE  +
    +
    + + + + + +
    +   + + +

    +Converts the list to a tuple. +

    +For example, +

    +

    +  BOOST_PP_LIST_TO_TUPLE(BOOST_PP_TUPLE_TO_LIST(3,(A,B,C)))
    +
    +

    +expands to (A,B,C). +

    +NOTE: The supported size of the list being converted to a tuple is limited by BOOST_PP_LIMIT_MAG rather than BOOST_PP_LIMIT_TUPLE.

    +


    +

    © Copyright Housemarque Oy 2001

    +

    Permission to copy, use, modify, sell and distribute this document is granted + provided this copyright notice appears in all copies. This document is provided + "as is" without express or implied warranty, and with no claim as to its suitability + for any purpose.

    + +

    Generated:

    diff --git a/doc/reference/transform_8hpp.html b/doc/reference/transform_8hpp.html new file mode 100644 index 0000000..512f907 --- /dev/null +++ b/doc/reference/transform_8hpp.html @@ -0,0 +1,76 @@ +c++boost.gif (8819 bytes) +
    + +
    +Main Page   File List   File Members  
    +

    transform.hpp File Reference

    + + + +

    Defines

    #define BOOST_PP_LIST_TRANSFORM(F, P, L)
     Applies the macro F(D,P,X) to each element X of the list producing a new list. More...

    +

    Detailed Description

    + Click here to see the header. +

    +


    Define Documentation

    +

    + + + + +
    + + + + + + + + + + + + + +
    #define BOOST_PP_LIST_TRANSFORMF,
    P,
      +
    +
    + + + + + +
    +   + + +

    +Applies the macro F(D,P,X) to each element X of the list producing a new list. +

    +In other words, BOOST_PP_LIST_TRANSFORM(F,P,L) expands to same as: +

    +

    +  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(F(D,P,BOOST_PP_LIST_AT(L,BOOST_PP_DEC(BOOST_PP_LIST_SIZE(L)))),
    +  BOOST_PP_LIST_NIL) ... ))
    +
    +

    +For example, +

    +

    +  BOOST_PP_LIST_TRANSFORM(BOOST_PP_ADD_D,2,BOOST_PP_TUPLE_TO_LIST(2,(1,2)))
    +
    +

    +expands to a list containing 3 and 4.

    +


    +

    © Copyright Housemarque Oy 2001

    +

    Permission to copy, use, modify, sell and distribute this document is granted + provided this copyright notice appears in all copies. This document is provided + "as is" without express or implied warranty, and with no claim as to its suitability + for any purpose.

    + +

    Generated:

    diff --git a/doc/reference/while_8hpp.html b/doc/reference/while_8hpp.html index ab589f1..6aeaac2 100644 --- a/doc/reference/while_8hpp.html +++ b/doc/reference/while_8hpp.html @@ -56,14 +56,14 @@ Iterates F(D,X) while C(D,X) is true.

    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.

    -D is the recursion depth and should only be used as a parameter to other macros implemented using BOOST_PP_WHILE(). Such macros include BOOST_PP_ADD() and other arithmetic operations. For each macro implemented using BOOST_PP_WHILE(), there is a version of the macro, distinguished by the _D suffix (e.g. BOOST_PP_ADD_D()), 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/C++ preprocessor. +D is the recursion depth and should only be used as a parameter to other macros implemented using BOOST_PP_WHILE(). Such macros include BOOST_PP_ADD() and other arithmetic operations. For each macro implemented using BOOST_PP_WHILE(), there is a version of the macro, distinguished by the _D suffix (e.g. BOOST_PP_ADD_D()), 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.

    NOTE: The value of the D parameter may exceed BOOST_PP_LIMIT_MAG.

    Usage

    -Using BOOST_PP_WHILE() is a bit tricky. This is due to the C/C++ preprocessor limitations. It is recommended to take a look at the implementations of the various PREPROCESSOR library primitives such as BOOST_PP_ADD() for additional examples. +Using BOOST_PP_WHILE() is a bit tricky. This is due to the C++ preprocessor limitations. It is recommended to take a look at the implementations of the various PREPROCESSOR library primitives such as BOOST_PP_ADD() for additional examples.

    Here is a trivial example that simply counts down from N to 0 ultimately expanding to a 0:

    @@ -99,7 +99,7 @@ For a more complex example, let's take a look at an implementation of #include #include +#include #include #include #include