diff --git a/include/boost/preprocessor/arithmetic.hpp b/include/boost/preprocessor/arithmetic.hpp index 2ecacde..89e4d76 100644 --- a/include/boost/preprocessor/arithmetic.hpp +++ b/include/boost/preprocessor/arithmetic.hpp @@ -13,7 +13,7 @@ * See http://www.boost.org for most recent version. */ -/**

Includes all arithmetic headers.

*/ +/**

Includes all arithmetic headers.

*/ #include #include diff --git a/include/boost/preprocessor/arithmetic/add.hpp b/include/boost/preprocessor/arithmetic/add.hpp index e930ba4..b06c30c 100644 --- a/include/boost/preprocessor/arithmetic/add.hpp +++ b/include/boost/preprocessor/arithmetic/add.hpp @@ -18,14 +18,15 @@ #include #include -/**

Expands to the sum of X and Y.

+/**

Expands to the sum of X and Y.

-

For example, BOOST_PP_ADD(4,3) expands to 7 (a single token).

+

For example, BOOST_PP_ADD(4,3) expands to 7 (a +single token).

-

Uses

-
    -
  • BOOST_PP_WHILE() -
+

Uses

+
    +
  • BOOST_PP_WHILE()
  • +
*/ #define BOOST_PP_ADD(X,Y) BOOST_PP_ADD_D(0,X,Y) @@ -40,6 +41,6 @@ #endif #endif -/**

Obsolete. Use BOOST_PP_ADD().

*/ +/**

Obsolete. Use BOOST_PP_ADD().

*/ #define BOOST_PREPROCESSOR_ADD(X,Y) BOOST_PP_ADD(X,Y) #endif diff --git a/include/boost/preprocessor/arithmetic/div.hpp b/include/boost/preprocessor/arithmetic/div.hpp index 4b47044..dc7eef7 100644 --- a/include/boost/preprocessor/arithmetic/div.hpp +++ b/include/boost/preprocessor/arithmetic/div.hpp @@ -16,14 +16,15 @@ #include #include -/**

Expands to the quotient of X and Y.

+/**

Expands to the quotient of X and Y.

-

For example, BOOST_PP_DIV(4,3) expands to 1 (a single token).

+

For example, BOOST_PP_DIV(4,3) expands to 1 (a +single token).

-

Uses

-
    -
  • BOOST_PP_WHILE() -
+

Uses

+
    +
  • BOOST_PP_WHILE()
  • +
*/ #define BOOST_PP_DIV(X,Y) BOOST_PP_DIV_D(0,X,Y) @@ -38,6 +39,6 @@ #endif #endif -/**

Obsolete. Use BOOST_PP_DIV().

*/ +/**

Obsolete. Use BOOST_PP_DIV().

*/ #define BOOST_PREPROCESSOR_DIV(X,Y) BOOST_PP_DIV(X,Y) #endif diff --git a/include/boost/preprocessor/arithmetic/mod.hpp b/include/boost/preprocessor/arithmetic/mod.hpp index aa3f2c8..73aaca6 100644 --- a/include/boost/preprocessor/arithmetic/mod.hpp +++ b/include/boost/preprocessor/arithmetic/mod.hpp @@ -15,14 +15,15 @@ #include -/**

Expands to the remainder of X and Y.

+/**

Expands to the remainder of X and Y.

-

For example, BOOST_PP_MOD(4,3) expands to 1 (a single token).

+

For example, BOOST_PP_MOD(4,3) expands to 1 (a +single token).

-

Uses

-
    -
  • BOOST_PP_WHILE() -
+

Uses

+
    +
  • BOOST_PP_WHILE()
  • +
*/ #define BOOST_PP_MOD(X,Y) BOOST_PP_MOD_D(0,X,Y) @@ -32,6 +33,6 @@ #define BOOST_PP_MOD_F(D,P) (BOOST_PP_SUB_D(D,BOOST_PP_TUPLE2_ELEM0 P,BOOST_PP_TUPLE2_ELEM1 P),BOOST_PP_TUPLE2_ELEM1 P) #endif -/**

Obsolete. Use BOOST_PP_MOD().

*/ +/**

Obsolete. Use BOOST_PP_MOD().

*/ #define BOOST_PREPROCESSOR_MOD(X,Y) BOOST_PP_MOD(X,Y) #endif diff --git a/include/boost/preprocessor/arithmetic/mul.hpp b/include/boost/preprocessor/arithmetic/mul.hpp index d81308b..21a0649 100644 --- a/include/boost/preprocessor/arithmetic/mul.hpp +++ b/include/boost/preprocessor/arithmetic/mul.hpp @@ -15,14 +15,15 @@ #include -/**

Expands to the product of X and Y.

+/**

Expands to the product of X and Y.

-

For example, BOOST_PP_MUL(4,3) expands to 12 (a single token).

+

For example, BOOST_PP_MUL(4,3) expands to 12 (a +single token).

-

Uses

-
    -
  • BOOST_PP_WHILE() -
+

Uses

+
    +
  • BOOST_PP_WHILE()
  • +
*/ #define BOOST_PP_MUL(X,Y) BOOST_PP_MUL_D(0,X,Y) @@ -37,6 +38,6 @@ #endif #endif -/**

Obsolete. Use BOOST_PP_MUL().

*/ +/**

Obsolete. Use BOOST_PP_MUL().

*/ #define BOOST_PREPROCESSOR_MUL(X,Y) BOOST_PP_MUL(X,Y) #endif diff --git a/include/boost/preprocessor/arithmetic/sub.hpp b/include/boost/preprocessor/arithmetic/sub.hpp index 8e7309d..dc440d6 100644 --- a/include/boost/preprocessor/arithmetic/sub.hpp +++ b/include/boost/preprocessor/arithmetic/sub.hpp @@ -17,14 +17,15 @@ #include #include -/**

Expands to the difference of X and Y.

+/**

Expands to the difference of X and Y.

-

For example, BOOST_PP_SUB(4,3) expands to 1 (a single token).

+

For example, BOOST_PP_SUB(4,3) expands to 1 (a +single token).

-

Uses

-
    -
  • BOOST_PP_WHILE() -
+

Uses

+
    +
  • BOOST_PP_WHILE()
  • +
*/ #define BOOST_PP_SUB(X,Y) BOOST_PP_SUB_D(0,X,Y) @@ -39,6 +40,6 @@ #endif #endif -/**

Obsolete. Use BOOST_PP_SUB(X,Y).

*/ +/**

Obsolete. Use BOOST_PP_SUB(X,Y).

*/ #define BOOST_PREPROCESSOR_SUB(X,Y) BOOST_PP_SUB(X,Y) #endif diff --git a/include/boost/preprocessor/assert_msg.hpp b/include/boost/preprocessor/assert_msg.hpp index 723b521..fa70ae3 100644 --- a/include/boost/preprocessor/assert_msg.hpp +++ b/include/boost/preprocessor/assert_msg.hpp @@ -16,9 +16,10 @@ #include #include -/**

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

*/ +/**

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

*/ #define BOOST_PP_ASSERT_MSG(C,MSG) BOOST_PP_IF(C,BOOST_PP_EMPTY,MSG BOOST_PP_EMPTY)() -/**

Obsolete. Use BOOST_PP_ASSERT_MSG().

*/ +/**

Obsolete. Use BOOST_PP_ASSERT_MSG().

*/ #define BOOST_PREPROCESSOR_ASSERT_MSG(C,MSG) BOOST_PP_ASSERT_MSG(C,MSG) #endif diff --git a/include/boost/preprocessor/cat.hpp b/include/boost/preprocessor/cat.hpp index 8ff1930..2d2faea 100644 --- a/include/boost/preprocessor/cat.hpp +++ b/include/boost/preprocessor/cat.hpp @@ -13,50 +13,13 @@ * See http://www.boost.org for most recent version. */ -/**

Delays the catenation of X and Y.

+/**

Concatenates X and Y after they are macro +expanded.

-

For example,

- -
-  #define STATIC_ASSERT(EXPR)\
-    enum\
-    { BOOST_PP_CAT(static_check_,__LINE__) = (EXPR) ? 1 : -1\
-    };\
-    typedef char\
-      BOOST_PP_CAT(static_assert_,__LINE__)\
-      [ BOOST_PP_CAT(static_check_,__LINE__)\
-      ]
-
-  // ...
-
-  STATIC_ASSERT(sizeof(int) <= sizeof(long));
-
- -

expands to:

- -
-  enum
-  { static_check_152 = (sizeof(int) <= sizeof(long)) ? 1 : -1
-  };
-  typedef char
-    static_assert_152
-    [ static_check_152
-    ];
-
- -

Using BOOST_PP_CAT() above lets the PP expand the __LINE__. If the above -code would use the ## operator directly then __LINE__ would not be expanded and -the above would expand to:

- -
-  enum
-  { static_check___LINE__ = (sizeof(int) <= sizeof(long)) ? 1 : -1
-  };
-  typedef char
-    static_assert___LINE__
-    [ static_check___LINE__
-    ];
-
+

Example

+ */ #define BOOST_PP_CAT(X,Y) BOOST_PP_CAT_DELAY(X,Y) @@ -65,6 +28,6 @@ the above would expand to:

#define BOOST_PP_DO_CAT(X,Y) X##Y #endif -/**

Obsolete. Use BOOST_PP_CAT().

*/ +/**

Obsolete. Use BOOST_PP_CAT().

*/ #define BOOST_PREPROCESSOR_CAT(X,Y) BOOST_PP_CAT(X,Y) #endif diff --git a/include/boost/preprocessor/comma.hpp b/include/boost/preprocessor/comma.hpp index 89cd08e..c12ddb2 100644 --- a/include/boost/preprocessor/comma.hpp +++ b/include/boost/preprocessor/comma.hpp @@ -13,15 +13,15 @@ * See http://www.boost.org for most recent version. */ -/**

Expands to a comma. Can be used with BOOST_PP_IF().

+/**

Expands to a comma. Can be used with BOOST_PP_IF().

-

See

-
    -
  • BOOST_PP_COMMA_IF() -
+

See

+
    +
  • BOOST_PP_COMMA_IF()
  • +
*/ #define BOOST_PP_COMMA() , -/**

Obsolete. Use BOOST_PP_COMMA().

*/ +/**

Obsolete. Use BOOST_PP_COMMA().

*/ #define BOOST_PREPROCESSOR_COMMA() , #endif diff --git a/include/boost/preprocessor/comma_if.hpp b/include/boost/preprocessor/comma_if.hpp index 42a605b..3c34a11 100644 --- a/include/boost/preprocessor/comma_if.hpp +++ b/include/boost/preprocessor/comma_if.hpp @@ -17,9 +17,11 @@ #include #include -/**

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

*/ +/**

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

+*/ #define BOOST_PP_COMMA_IF(C) BOOST_PP_IF(C,BOOST_PP_COMMA,BOOST_PP_EMPTY)() -/**

Obsolete. Use BOOST_PP_COMMA_IF().

*/ +/**

Obsolete. Use BOOST_PP_COMMA_IF().

*/ #define BOOST_PREPROCESSOR_COMMA_IF(C) BOOST_PP_COMMA_IF(C) #endif diff --git a/include/boost/preprocessor/comparison.hpp b/include/boost/preprocessor/comparison.hpp index 7dc417b..b9bb152 100644 --- a/include/boost/preprocessor/comparison.hpp +++ b/include/boost/preprocessor/comparison.hpp @@ -13,7 +13,7 @@ * See http://www.boost.org for most recent version. */ -/**

Includes all comparison headers.

*/ +/**

Includes all comparison headers.

*/ #include #include diff --git a/include/boost/preprocessor/comparison/equal.hpp b/include/boost/preprocessor/comparison/equal.hpp index 494db20..4f8805c 100644 --- a/include/boost/preprocessor/comparison/equal.hpp +++ b/include/boost/preprocessor/comparison/equal.hpp @@ -16,12 +16,13 @@ #include #include -/**

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

+/**

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

-

Uses

-
    -
  • BOOST_PP_WHILE() -
+

Uses

+
    +
  • BOOST_PP_WHILE()
  • +
*/ #define BOOST_PP_EQUAL(X,Y) BOOST_PP_EQUAL_D(0,X,Y) @@ -29,6 +30,6 @@ #define BOOST_PP_EQUAL_D(D,X,Y) BOOST_PP_NOT(BOOST_PP_NOT_EQUAL_D(D,X,Y)) #endif -/**

Obsolete. Use BOOST_PP_EQUAL().

*/ +/**

Obsolete. Use BOOST_PP_EQUAL().

*/ #define BOOST_PREPROCESSOR_EQUAL(X,Y) BOOST_PP_EQUAL(X,Y) #endif diff --git a/include/boost/preprocessor/comparison/greater.hpp b/include/boost/preprocessor/comparison/greater.hpp index 8d8a90e..382a071 100644 --- a/include/boost/preprocessor/comparison/greater.hpp +++ b/include/boost/preprocessor/comparison/greater.hpp @@ -15,12 +15,13 @@ #include -/**

Expands to 1 if X>Y and 0 otherwise.

+/**

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

-

Uses

-
    -
  • BOOST_PP_WHILE() -
+

Uses

+
    +
  • BOOST_PP_WHILE()
  • +
*/ #define BOOST_PP_GREATER(X,Y) BOOST_PP_GREATER_D(0,X,Y) @@ -28,6 +29,6 @@ #define BOOST_PP_GREATER_D(D,X,Y) BOOST_PP_LESS_D(D,Y,X) #endif -/**

Obsolete. Use BOOST_PP_GREATER().

*/ +/**

Obsolete. Use BOOST_PP_GREATER().

*/ #define BOOST_PREPROCESSOR_GREATER(X,Y) BOOST_PP_GREATER(X,Y) #endif diff --git a/include/boost/preprocessor/comparison/greater_equal.hpp b/include/boost/preprocessor/comparison/greater_equal.hpp index 3ae8fe4..ad66c2c 100644 --- a/include/boost/preprocessor/comparison/greater_equal.hpp +++ b/include/boost/preprocessor/comparison/greater_equal.hpp @@ -15,12 +15,13 @@ #include -/**

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

+/**

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

-

Uses

-
    -
  • BOOST_PP_WHILE() -
+

Uses

+
    +
  • BOOST_PP_WHILE()
  • +
*/ #define BOOST_PP_GREATER_EQUAL(X,Y) BOOST_PP_GREATER_EQUAL_D(0,X,Y) @@ -28,6 +29,6 @@ #define BOOST_PP_GREATER_EQUAL_D(D,X,Y) BOOST_PP_LESS_EQUAL_D(D,Y,X) #endif -/**

Obsolete. Use BOOST_PP_GREATER_EQUAL().

*/ +/**

Obsolete. Use BOOST_PP_GREATER_EQUAL().

*/ #define BOOST_PREPROCESSOR_GREATER_EQUAL(X,Y) BOOST_PP_GREATER_EQUAL(X,Y) #endif diff --git a/include/boost/preprocessor/comparison/less.hpp b/include/boost/preprocessor/comparison/less.hpp index 7606ed5..468ec9b 100644 --- a/include/boost/preprocessor/comparison/less.hpp +++ b/include/boost/preprocessor/comparison/less.hpp @@ -17,12 +17,13 @@ #include #include -/**

Expands to 1 if X<Y and 0 otherwise.

+/**

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

-

Uses

-
    -
  • BOOST_PP_WHILE() -
+

Uses

+
    +
  • BOOST_PP_WHILE()
  • +
*/ #define BOOST_PP_LESS(X,Y) BOOST_PP_LESS_D(0,X,Y) @@ -30,6 +31,6 @@ #define BOOST_PP_LESS_D(D,X,Y) BOOST_PP_AND(BOOST_PP_NOT_EQUAL_D(D,X,Y),BOOST_PP_LESS_EQUAL_D(D,X,Y)) #endif -/**

Obsolete. Use BOOST_PP_LESS().

*/ +/**

Obsolete. Use BOOST_PP_LESS().

*/ #define BOOST_PREPROCESSOR_LESS(X,Y) BOOST_PP_LESS(X,Y) #endif diff --git a/include/boost/preprocessor/comparison/less_equal.hpp b/include/boost/preprocessor/comparison/less_equal.hpp index e248e88..3c1464b 100644 --- a/include/boost/preprocessor/comparison/less_equal.hpp +++ b/include/boost/preprocessor/comparison/less_equal.hpp @@ -16,12 +16,13 @@ #include #include -/**

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

+/**

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

-

Uses

-
    -
  • BOOST_PP_WHILE() -
+

Uses

+
    +
  • BOOST_PP_WHILE()
  • +
*/ #define BOOST_PP_LESS_EQUAL(X,Y) BOOST_PP_LESS_EQUAL_D(0,X,Y) @@ -29,6 +30,6 @@ #define BOOST_PP_LESS_EQUAL_D(D,X,Y) BOOST_PP_NOT(BOOST_PP_SUB_D(D,X,Y)) #endif -/**

Obsolete. Use BOOST_PP_LESS_EQUAL().

*/ +/**

Obsolete. Use BOOST_PP_LESS_EQUAL().

*/ #define BOOST_PREPROCESSOR_LESS_EQUAL(X,Y) BOOST_PP_LESS_EQUAL(X,Y) #endif diff --git a/include/boost/preprocessor/comparison/not_equal.hpp b/include/boost/preprocessor/comparison/not_equal.hpp index c4de120..5d5a6f3 100644 --- a/include/boost/preprocessor/comparison/not_equal.hpp +++ b/include/boost/preprocessor/comparison/not_equal.hpp @@ -17,12 +17,13 @@ #include #include -/**

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

+/**

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

-

Uses

-
    -
  • BOOST_PP_WHILE() -
+

Uses

+
    +
  • BOOST_PP_WHILE()
  • +
*/ #define BOOST_PP_NOT_EQUAL(X,Y) BOOST_PP_NOT_EQUAL_D(0,X,Y) @@ -30,6 +31,6 @@ #define BOOST_PP_NOT_EQUAL_D(D,X,Y) BOOST_PP_BOOL(BOOST_PP_ADD_D(D,BOOST_PP_SUB_D(D,X,Y),BOOST_PP_SUB_D(D,Y,X))) #endif -/**

Obsolete. Use BOOST_PP_NOT_EQUAL().

*/ +/**

Obsolete. Use BOOST_PP_NOT_EQUAL().

*/ #define BOOST_PREPROCESSOR_NOT_EQUAL(X,Y) BOOST_PP_NOT_EQUAL(X,Y) #endif diff --git a/include/boost/preprocessor/dec.hpp b/include/boost/preprocessor/dec.hpp index 29fbd67..18b2e73 100644 --- a/include/boost/preprocessor/dec.hpp +++ b/include/boost/preprocessor/dec.hpp @@ -13,14 +13,15 @@ * See http://www.boost.org for most recent version. */ -/**

Decrements X expanding to a single token.

+/**

Decrements X expanding to a single token.

-

For example, BOOST_PP_DEC(3) expands to 2 (a single token).

+

For example, BOOST_PP_DEC(3) expands to 2 (a +single token).

-

BOOST_PP_DEC() uses saturation arithmetic. Decrementing 0 yeilds a 0.

+

BOOST_PP_DEC() uses saturation arithmetic. Decrementing 0 yeilds a 0.

-

Only decimal integer literals in the range [0,BOOST_PP_LIMIT_MAG] are -supported.

+

Only decimal integer literals in the range [0,BOOST_PP_LIMIT_MAG] are +supported.

*/ #define BOOST_PP_DEC(X) BOOST_PP_DEC_DELAY(X) @@ -157,6 +158,6 @@ supported.

#define BOOST_PP_DEC128 127 #endif -/**

Obsolete. Use BOOST_PP_DEC().

*/ +/**

Obsolete. Use BOOST_PP_DEC().

*/ #define BOOST_PREPROCESSOR_DEC(X) BOOST_PP_DEC(X) #endif diff --git a/include/boost/preprocessor/empty.hpp b/include/boost/preprocessor/empty.hpp index ee5d17b..b1be5ea 100644 --- a/include/boost/preprocessor/empty.hpp +++ b/include/boost/preprocessor/empty.hpp @@ -13,60 +13,15 @@ * See http://www.boost.org for most recent version. */ -/**

Expands to nothing. Used with BOOST_PP_IF() and as an unused parameter.

+/**

Expands to nothing. Used with BOOST_PP_IF() and as an unused parameter.

-

Example usage as the implementation of BOOST_PP_COMMA_IF(C):

- -
-  #define BOOST_PP_COMMA_IF(C)\
-    BOOST_PP_IF(C,BOOST_PP_COMMA,BOOST_PP_EMPTY)()
-
- -

Example usage as an unused macro parameter:

- -
-  #define BOOST_PP_DEF(CV)\
-    template\
-    CV() typename implement_subscript_using_begin_subscript::value_type&\
-      implement_subscript_using_begin_subscript::operator[]\
-      ( index_type\
-          i\
-      ) CV()\
-    { return base::begin()[i];\
-    }
-
-  BOOST_PP_DEF(BOOST_PP_EMPTY)
-  BOOST_PP_DEF(const BOOST_PP_EMPTY)
-  #undef BOOST_PP_DEF
-
- -

The above expands to:

- -
-  template
-  typename implement_subscript_using_begin_subscript::value_type&
-    implement_subscript_using_begin_subscript::operator[]
-    ( index_type
-        i
-    )
-  { return base::begin()[i];
-  }
-
-  template
-  const typename implement_subscript_using_begin_subscript::value_type&
-    implement_subscript_using_begin_subscript::operator[]
-    ( index_type
-        i
-    ) const
-  { return base::begin()[i];
-  }
-
- -

In case you wonder, the above code is part of a generalized layer for -implementing the subscripting operators of a random access container.

+

Example

+ */ #define BOOST_PP_EMPTY() -/**

Obsolete. Use BOOST_PP_EMPTY().

*/ +/**

Obsolete. Use BOOST_PP_EMPTY().

*/ #define BOOST_PREPROCESSOR_EMPTY() #endif diff --git a/include/boost/preprocessor/enum.hpp b/include/boost/preprocessor/enum.hpp index cf2d37b..120ad26 100644 --- a/include/boost/preprocessor/enum.hpp +++ b/include/boost/preprocessor/enum.hpp @@ -17,18 +17,18 @@ #include #include -/**

Generates a comma separated list.

+/**

Generates a comma separated list.

-

In other words, expands to the sequence:

+

In other words, expands to the sequence:

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

Uses

-
    -
  • BOOST_PP_REPEAT() -
+

Uses

+
    +
  • BOOST_PP_REPEAT()
  • +
*/ #define BOOST_PP_ENUM(N,F,P) BOOST_PP_REPEAT(N,BOOST_PP_ENUM_F,(F,P)) diff --git a/include/boost/preprocessor/enum_params.hpp b/include/boost/preprocessor/enum_params.hpp index 8053f0c..5b52e50 100644 --- a/include/boost/preprocessor/enum_params.hpp +++ b/include/boost/preprocessor/enum_params.hpp @@ -16,18 +16,18 @@ #include #include -/**

Generates a comma separated list of parameters.

+/**

Generates a comma separated list of parameters.

-

In other words, expands to the sequence:

+

In other words, expands to the sequence:

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

Uses

-
    -
  • BOOST_PP_REPEAT() -
+

Uses

+
    +
  • BOOST_PP_REPEAT()
  • +
*/ #define BOOST_PP_ENUM_PARAMS(N,P) BOOST_PP_ENUM(N,BOOST_PP_ENUM_PARAMS_F,P) @@ -35,6 +35,6 @@ #define BOOST_PP_ENUM_PARAMS_F(I,P) BOOST_PP_CAT(P,I) #endif -/**

Obsolete. Use BOOST_PP_ENUM_PARAMS().

*/ +/**

Obsolete. Use BOOST_PP_ENUM_PARAMS().

*/ #define BOOST_PREPROCESSOR_ENUM_PARAMS(N,P) BOOST_PP_ENUM_PARAMS(N,P) #endif diff --git a/include/boost/preprocessor/enum_params_with_a_default.hpp b/include/boost/preprocessor/enum_params_with_a_default.hpp index 96b396f..687b1dd 100644 --- a/include/boost/preprocessor/enum_params_with_a_default.hpp +++ b/include/boost/preprocessor/enum_params_with_a_default.hpp @@ -16,18 +16,18 @@ #include #include -/**

Generates a comma separated list of parameters with a default.

+/**

Generates a comma separated list of parameters with a default.

-

In other words, expands to the sequence:

+

In other words, expands to the sequence:

-
-  P##0 = D, P##1 = D, ..., P##N-1 = D
-
+
+  BOOST_PP_CAT(P,0) = D, BOOST_PP_CAT(P,1) = D, ..., BOOST_PP_CAT(P,BOOST_PP_DEC(N)) = D
+
-

Uses

-
    -
  • BOOST_PP_REPEAT() -
+

Uses

+
    +
  • BOOST_PP_REPEAT()
  • +
*/ #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)) @@ -39,6 +39,6 @@ #endif #endif -/**

Obsolete. Use BOOST_PP_ENUM_PARAMS_WITH_A_DEFAULT().

*/ +/**

Obsolete. Use BOOST_PP_ENUM_PARAMS_WITH_A_DEFAULT().

*/ #define BOOST_PREPROCESSOR_ENUM_PARAMS_WITH_A_DEFAULT(N,P,D) BOOST_PP_ENUM_PARAMS_WITH_A_DEFAULT(N,P,D) #endif diff --git a/include/boost/preprocessor/enum_params_with_defaults.hpp b/include/boost/preprocessor/enum_params_with_defaults.hpp index c7583c3..2c80df8 100644 --- a/include/boost/preprocessor/enum_params_with_defaults.hpp +++ b/include/boost/preprocessor/enum_params_with_defaults.hpp @@ -16,18 +16,21 @@ #include #include -/**

Generates a comma separated list of parameters with defaults.

+/**

Generates a comma separated list of parameters with defaults.

-

In other words, expands to the sequence:

+

In other words, expands to the sequence:

-
-  P##0 = D##0, P##1 = D##1, ..., P##N-1 = D##N-1
-
+
+  BOOST_PP_CAT(P,0) = BOOST_PP_CAT(D,0),
+  BOOST_PP_CAT(P,1) = BOOST_PP_CAT(D,1),
+  ...,
+  BOOST_PP_CAT(P,BOOST_PP_DEC(N)) = BOOST_PP_CAT(D,BOOST_PP_DEC(N))
+
-

Uses

-
    -
  • BOOST_PP_REPEAT() -
+

Uses

+
    +
  • BOOST_PP_REPEAT()
  • +
*/ #define BOOST_PP_ENUM_PARAMS_WITH_DEFAULTS(N,P,D) BOOST_PP_ENUM(N,BOOST_PP_ENUM_PARAMS_WITH_DEFAULTS_F,(P,D)) @@ -39,6 +42,6 @@ #endif #endif -/**

Obsolete. Use BOOST_PP_ENUM_PARAMS_WITH_DEFAULTS().

*/ +/**

Obsolete. Use BOOST_PP_ENUM_PARAMS_WITH_DEFAULTS().

*/ #define BOOST_PREPROCESSOR_ENUM_PARAMS_WITH_DEFAULTS(N,P,D) BOOST_PP_ENUM_PARAMS_WITH_DEFAULTS(N,P,D) #endif diff --git a/include/boost/preprocessor/enum_shifted.hpp b/include/boost/preprocessor/enum_shifted.hpp index 29c29fe..3b519fc 100644 --- a/include/boost/preprocessor/enum_shifted.hpp +++ b/include/boost/preprocessor/enum_shifted.hpp @@ -17,18 +17,18 @@ #include #include -/**

Generates a comma separated shifted list.

+/**

Generates a comma separated shifted list.

-

In other words, expands to the sequence:

+

In other words, expands to the sequence:

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

Uses

-
    -
  • BOOST_PP_REPEAT() -
+

Uses

+
    +
  • 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)) diff --git a/include/boost/preprocessor/enum_shifted_params.hpp b/include/boost/preprocessor/enum_shifted_params.hpp index e3e3eba..e19b803 100644 --- a/include/boost/preprocessor/enum_shifted_params.hpp +++ b/include/boost/preprocessor/enum_shifted_params.hpp @@ -16,24 +16,24 @@ #include #include -/**

Generates a comma separated list of shifted actual parameters.

+/**

Generates a comma separated list of shifted actual parameters.

-

In other words, expands to the sequence:

+

In other words, expands to the sequence:

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

Uses

-
    -
  • BOOST_PP_REPEAT() -
+

Uses

+
    +
  • BOOST_PP_REPEAT()
  • +
-

Rationale

-
    -
  • This macro facilitates a typical usage of the library. Shifted parameter - lists are common in template metaprograms. -
+

Rationale

+
    +
  • This macro facilitates a typical usage of the library. Shifted parameter + lists are common in template metaprograms.
  • +
*/ #define BOOST_PP_ENUM_SHIFTED_PARAMS(N,P) BOOST_PP_ENUM_SHIFTED(N,BOOST_PP_ENUM_SHIFTED_PARAMS_F,P) @@ -41,6 +41,6 @@ #define BOOST_PP_ENUM_SHIFTED_PARAMS_F(I,P) BOOST_PP_CAT(P,I) #endif -/**

Obsolete. Use BOOST_PP_ENUM_SHIFTED_PARAMS().

*/ +/**

Obsolete. Use BOOST_PP_ENUM_SHIFTED_PARAMS().

*/ #define BOOST_PREPROCESSOR_ENUM_SHIFTED_PARAMS(N,P) BOOST_PP_ENUM_SHIFTED_PARAMS(N,P) #endif diff --git a/include/boost/preprocessor/expand.hpp b/include/boost/preprocessor/expand.hpp index 7ad8bfe..9f81b50 100644 --- a/include/boost/preprocessor/expand.hpp +++ b/include/boost/preprocessor/expand.hpp @@ -15,6 +15,6 @@ #include -/**

Essentially macro expands the parameter X twice.

*/ +/**

Essentially macro expands the parameter X twice.

*/ #define BOOST_PP_EXPAND(X) X #endif diff --git a/include/boost/preprocessor/for.hpp b/include/boost/preprocessor/for.hpp index 7d0e13d..7233c67 100644 --- a/include/boost/preprocessor/for.hpp +++ b/include/boost/preprocessor/for.hpp @@ -16,45 +16,45 @@ #include #include -/**

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

+/**

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

-

In other words, expands to the sequence:

+

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)...)))
-
+
-

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

+

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

-

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 - 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. -
  • R is the recursion depth and should only be used as a parameter to +

    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 + 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.
    • +
    • 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. -
    + by the C++ preprocessor.
  • +
-

BOOST_PP_REPEAT() vs BOOST_PP_FOR()

+

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_FOR() is a generalization of BOOST_PP_REPEAT(). This means that +BOOST_PP_REPEAT() can be implemented using BOOST_PP_FOR(). However, BOOST_PP_REPEAT() was introduced earlier, is generally easier to use, and is -still quite useful on its own.

+still quite useful on its own.

-

2D and 3D repetition

+

2D and 3D repetition

-

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

+

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

*/ #define BOOST_PP_FOR(X,C,F,I) BOOST_PP_FOR0(X,C,F,I) diff --git a/include/boost/preprocessor/identity.hpp b/include/boost/preprocessor/identity.hpp index 193d4b0..66c14ab 100644 --- a/include/boost/preprocessor/identity.hpp +++ b/include/boost/preprocessor/identity.hpp @@ -15,28 +15,25 @@ #include -/**

Expands to X once invoked.

+/**

Expands to X once invoked.

-

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

+

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

-

For example,

+

For example,

-
-  BOOST_PP_IDENTITY(X)()
-
+
+  BOOST_PP_IF(1,BOOST_PP_IDENTITY(X),BOOST_PP_EMPTY)()
+
-

expands to:

+

expands to:

-
+
   X
-
- -

NOTE: If BOOST_PP_IDENTITY() is not invoked, the expansion will not be -usable.

+
*/ #define BOOST_PP_IDENTITY(X) X BOOST_PP_EMPTY -/**

Obsolete. Use BOOST_PP_IDENTITY().

*/ +/**

Obsolete. Use BOOST_PP_IDENTITY().

*/ #define BOOST_PREPROCESSOR_IDENTITY(X) BOOST_PP_IDENTITY(X) #endif diff --git a/include/boost/preprocessor/if.hpp b/include/boost/preprocessor/if.hpp index dddd365..7a343c7 100644 --- a/include/boost/preprocessor/if.hpp +++ b/include/boost/preprocessor/if.hpp @@ -16,10 +16,11 @@ #include #include -/**

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

+/**

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

-

BOOST_PP_IF() enables convenient generation of lists using -BOOST_PP_REPEAT().

+

BOOST_PP_IF() enables convenient generation of lists using +BOOST_PP_REPEAT().

*/ #define BOOST_PP_IF(C,T,E) BOOST_PP_IF_BOOL(BOOST_PP_BOOL(C))(E,T) @@ -28,6 +29,6 @@ BOOST_PP_REPEAT().

#define BOOST_PP_IF_BOOL_DELAY(C) BOOST_PP_TUPLE2_ELEM##C #endif -/**

Obsolete. Use BOOST_PP_IF().

*/ +/**

Obsolete. Use BOOST_PP_IF().

*/ #define BOOST_PREPROCESSOR_IF(C,T,E) BOOST_PP_IF(C,T,E) #endif diff --git a/include/boost/preprocessor/inc.hpp b/include/boost/preprocessor/inc.hpp index 74550a8..964b7ee 100644 --- a/include/boost/preprocessor/inc.hpp +++ b/include/boost/preprocessor/inc.hpp @@ -13,15 +13,16 @@ * See http://www.boost.org for most recent version. */ -/**

Increments X expanding to a single token.

+/**

Increments X expanding to a single token.

-

For example, BOOST_PP_INC(3) expands to 4 (a single token).

+

For example, BOOST_PP_INC(3) expands to 4 (a +single token).

-

BOOST_PP_INC() uses saturation arithmetic. Incrementing a -BOOST_PP_LIMIT_MAG yields a BOOST_PP_LIMIT_MAG.

+

BOOST_PP_INC() uses saturation arithmetic. Incrementing a +BOOST_PP_LIMIT_MAG yields a BOOST_PP_LIMIT_MAG.

-

Only decimal integer literals in the range [0,BOOST_PP_LIMIT_MAG] are -supported.

+

Only decimal integer literals in the range [0,BOOST_PP_LIMIT_MAG] are +supported.

*/ #define BOOST_PP_INC(X) BOOST_PP_INC_DELAY(X) @@ -158,6 +159,6 @@ supported.

#define BOOST_PP_INC128 128 #endif -/**

Obsolete. Use BOOST_PP_INC().

*/ +/**

Obsolete. Use BOOST_PP_INC().

*/ #define BOOST_PREPROCESSOR_INC(X) BOOST_PP_INC(X) #endif diff --git a/include/boost/preprocessor/limits.hpp b/include/boost/preprocessor/limits.hpp index 3de3bb2..f23e7fc 100644 --- a/include/boost/preprocessor/limits.hpp +++ b/include/boost/preprocessor/limits.hpp @@ -13,40 +13,41 @@ * See http://www.boost.org for most recent version. */ -/**

Expands to the number of dimensions of repeat supported by the -library.

+/**

Expands to the number of dimensions of repeat supported by the +library.

-

The repeat macros are named BOOST_PP_REPEAT(), BOOST_PP_REPEAT_2ND(), -BOOST_PP_REPEAT_3RD(), ...

+

The repeat macros are named BOOST_PP_REPEAT(), BOOST_PP_REPEAT_2ND(), +BOOST_PP_REPEAT_3RD(), ...

*/ #define BOOST_PP_LIMIT_DIM 3 -/**

Expands to the maximum straight numeric literal supported by the -library.

+/**

Expands to the maximum straight numeric literal supported by the +library.

-

This is also the limit of the repetition primitives (BOOST_PP_ENUM family -and BOOST_PP_REPEAT family).

+

This is also the limit of the repetition primitives (BOOST_PP_ENUM family +and BOOST_PP_REPEAT family).

-

NOTES:

-
    -
  • Only decimal integer literals in the range [0,BOOST_PP_LIMIT_MAG] - are supported. -
  • All arithmetic operations (ADD,SUB,MUL,DIV) use saturation arithmetic. -
  • The maximum repetition count supported by the library may not be reached - due to compiler limitations. -
+

Note

+
    +
  • Only decimal integer literals in the range [0, BOOST_PP_LIMIT_MAG] + are supported.
  • +
  • All arithmetic operations (BOOST_PP_ADD(), BOOST_PP_SUB(), + BOOST_PP_MUL(), BOOST_PP_DIV()) use saturation arithmetic.
  • +
  • The maximum repetition count supported by the library may not be reached + due to compiler limitations.
  • +
*/ #define BOOST_PP_LIMIT_MAG 128 -/**

Expands to the maximum tuple length supported by the library.

*/ +/**

Expands to the maximum tuple length supported by the library.

*/ #define BOOST_PP_LIMIT_TUPLE 16 -/**

Obsolete. Use BOOST_PP_LIMIT_DIM.

*/ +/**

Obsolete. Use BOOST_PP_LIMIT_DIM.

*/ #define BOOST_PREPROCESSOR_LIMIT_DIM BOOST_PP_LIMIT_DIM -/**

Obsolete. Use BOOST_PP_LIMIT_MAG.

*/ +/**

Obsolete. Use BOOST_PP_LIMIT_MAG.

*/ #define BOOST_PREPROCESSOR_LIMIT_MAG BOOST_PP_LIMIT_MAG -/**

Obsolete. Use BOOST_PP_LIMIT_TUPLE.

*/ +/**

Obsolete. Use BOOST_PP_LIMIT_TUPLE.

*/ #define BOOST_PREPROCESSOR_LIMIT_TUPLE BOOST_PP_LIMIT_TUPLE #endif diff --git a/include/boost/preprocessor/list.hpp b/include/boost/preprocessor/list.hpp index 1026375..7d421ff 100644 --- a/include/boost/preprocessor/list.hpp +++ b/include/boost/preprocessor/list.hpp @@ -13,7 +13,7 @@ * See http://www.boost.org for most recent version. */ -/**

Includes all list headers.

*/ +/**

Includes all list headers.

*/ #include #include diff --git a/include/boost/preprocessor/list/adt.hpp b/include/boost/preprocessor/list/adt.hpp index 56475d0..5efaee2 100644 --- a/include/boost/preprocessor/list/adt.hpp +++ b/include/boost/preprocessor/list/adt.hpp @@ -13,69 +13,71 @@ * See http://www.boost.org for most recent version. */ -/**

This header defines the fundamental list operations.

+/**

This header defines the fundamental list operations.

-

Note

-
    -
  • The internal representation of lists is hidden. Although there aren't +

    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.

      -
    + writing code that depends on the internal representation details.
  • +
*/ #include #include -/**

List constructor.

+/**

List constructor.

-

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

+

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:

+

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.

+

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

+ +

Longer lists can be built with the help of BOOST_PP_LIST_APPEND().

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

List nil constructor.

*/ +/**

List nil constructor.

*/ #define BOOST_PP_LIST_NIL (_,_,0) -/**

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

*/ +/**

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

*/ #if !defined(BOOST_NO_COMPILER_CONFIG) && defined(__MWERKS__) && __MWERKS__ <= 0x2406 # define BOOST_PP_LIST_IS_CONS(L) BOOST_PP_TUPLE_ELEM(3,2,L) #else # define BOOST_PP_LIST_IS_CONS(L) BOOST_PP_TUPLE3_ELEM2 L #endif -/**

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

*/ +/**

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

*/ #if !defined(BOOST_NO_COMPILER_CONFIG) && defined(__MWERKS__) && __MWERKS__ <= 0x2406 # define BOOST_PP_LIST_IS_NIL(L) BOOST_PP_NOT(BOOST_PP_TUPLE_ELEM(3,2,L)) #else # define BOOST_PP_LIST_IS_NIL(L) BOOST_PP_NOT(BOOST_PP_TUPLE3_ELEM2 L) #endif -/**

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

+/**

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

-

For example,

+

For example,

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

expands to 1.

+

expands to 1.

*/ #if !defined(BOOST_NO_COMPILER_CONFIG) && defined(__MWERKS__) && __MWERKS__ <= 0x2406 # define BOOST_PP_LIST_FIRST(L) BOOST_PP_TUPLE_ELEM(3,0,L) @@ -83,15 +85,21 @@ BOOST_PP_LIST_CONS(). For example,

# define BOOST_PP_LIST_FIRST(L) BOOST_PP_TUPLE3_ELEM0 L #endif -/**

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

+/**

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

-

For example,

+

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.

+

expands to the same as:

+ +
+  BOOST_PP_TUPLE_TO_LIST(4,(2,3,4,5))
+
*/ #if !defined(BOOST_NO_COMPILER_CONFIG) && defined(__MWERKS__) && __MWERKS__ <= 0x2406 # define BOOST_PP_LIST_REST(L) BOOST_PP_TUPLE_ELEM(3,1,L) diff --git a/include/boost/preprocessor/list/append.hpp b/include/boost/preprocessor/list/append.hpp index 03b4358..448be9d 100644 --- a/include/boost/preprocessor/list/append.hpp +++ b/include/boost/preprocessor/list/append.hpp @@ -15,23 +15,27 @@ #include -/**

Catenates two lists together.

+/**

Catenates two lists together.

-

For example,

+

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.

+

expands to the same as:

-

Uses

-
    -
  • BOOST_PP_WHILE() -
+
+  BOOST_PP_TUPLE_TO_LIST(4,(1,2,3,4))
+
+ +

Uses

+
    +
  • BOOST_PP_LIST_FOLD_RIGHT()
  • +
*/ #define BOOST_PP_LIST_APPEND(L,P) BOOST_PP_LIST_APPEND_D(0,L,P) diff --git a/include/boost/preprocessor/list/at.hpp b/include/boost/preprocessor/list/at.hpp index 820ac2e..e94d5a2 100644 --- a/include/boost/preprocessor/list/at.hpp +++ b/include/boost/preprocessor/list/at.hpp @@ -15,20 +15,21 @@ #include -/**

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

+/**

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

-

For example,

+

For example,

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

expands to B.

+

expands to B.

-

Uses

-
    -
  • BOOST_PP_WHILE() -
+

Uses

+
    +
  • BOOST_PP_WHILE()
  • +
*/ #define BOOST_PP_LIST_AT(L,I) BOOST_PP_LIST_AT_D(0,L,I) diff --git a/include/boost/preprocessor/list/cat.hpp b/include/boost/preprocessor/list/cat.hpp index d17fa61..07b0026 100644 --- a/include/boost/preprocessor/list/cat.hpp +++ b/include/boost/preprocessor/list/cat.hpp @@ -16,20 +16,24 @@ #include #include -/**

Catenates all elements of the list.

+/**

Catenates all elements of the list.

-

For example,

+

For example,

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

expands to 123.

+

expands to:

-

Uses

-
    -
  • BOOST_PP_WHILE() -
+
+  123
+
+ +

Uses

+
    +
  • BOOST_PP_LIST_FOLD_LEFT()
  • +
*/ #define BOOST_PP_LIST_CAT(L) BOOST_PP_LIST_CAT_D(0,L) diff --git a/include/boost/preprocessor/list/enum.hpp b/include/boost/preprocessor/list/enum.hpp index 245559c..f69a440 100644 --- a/include/boost/preprocessor/list/enum.hpp +++ b/include/boost/preprocessor/list/enum.hpp @@ -16,24 +16,24 @@ #include #include -/**

Converts the list to a comma separated list.

+/**

Converts the list to a comma separated list.

-

For example,

+

For example,

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

expands to:

+

expands to:

-
-  A, B, C
-
+
+  A,B,C
+
-

Uses

-
    -
  • BOOST_PP_FOR() -
+

Uses

+
    +
  • BOOST_PP_LIST_FOR_EACH()
  • +
*/ #define BOOST_PP_LIST_ENUM(L) BOOST_PP_LIST_ENUM_R(0,L) diff --git a/include/boost/preprocessor/list/filter.hpp b/include/boost/preprocessor/list/filter.hpp index 9d28fd1..e39b141 100644 --- a/include/boost/preprocessor/list/filter.hpp +++ b/include/boost/preprocessor/list/filter.hpp @@ -15,20 +15,25 @@ #include -/**

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

+/**

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

-

For example,

+

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.

+

expands to the same as:

-

Uses

-
    -
  • BOOST_PP_WHILE() -
+
+  BOOST_PP_TUPLE_TO_LIST(2,(1,3))
+
+ +

Uses

+
    +
  • BOOST_PP_LIST_FOLD_RIGHT()
  • +
*/ #define BOOST_PP_LIST_FILTER(F,P,L) BOOST_PP_LIST_FILTER_D(0,F,P,L) diff --git a/include/boost/preprocessor/list/first_n.hpp b/include/boost/preprocessor/list/first_n.hpp index 405ce0d..bf8aaff 100644 --- a/include/boost/preprocessor/list/first_n.hpp +++ b/include/boost/preprocessor/list/first_n.hpp @@ -17,20 +17,30 @@ #include #include -/**

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

+/**

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

-

For example,

+

For example,

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

expands to a list containing + and -.

+

expands to the same as:

-

Uses

-
    -
  • BOOST_PP_WHILE() -
+
+  BOOST_PP_TUPLE_TO_LIST(2,(+,-))
+
+ +

See

+
    +
  • BOOST_PP_LIST_REST_N()
  • +
+ +

Uses

+
    +
  • BOOST_PP_LIST_FOLD_LEFT()
  • +
*/ #define BOOST_PP_LIST_FIRST_N(N,L) BOOST_PP_LIST_FIRST_N_D(0,N,L) diff --git a/include/boost/preprocessor/list/fold_left.hpp b/include/boost/preprocessor/list/fold_left.hpp index ae079cf..63e8c3b 100644 --- a/include/boost/preprocessor/list/fold_left.hpp +++ b/include/boost/preprocessor/list/fold_left.hpp @@ -16,39 +16,34 @@ #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 F(D,P,X) for each element X of the +list L (from the left or the start of the list).

-

In other words,

+

In other words, expands to:

-
-  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

-
    -
  • Folding, or accumulation, is a very general pattern of computation. - Most list operations can be implemented in terms of folding. -
+

Note

+
    +
  • Folding, or accumulation, is a very general pattern of computation. + Most list operations can be implemented in terms of folding.
  • +
-

See

-
    -
  • BOOST_PP_LIST_FOLD_RIGHT() -
+

See

+
    +
  • BOOST_PP_LIST_FOLD_RIGHT()
  • +
-

Uses

-
    -
  • BOOST_PP_WHILE() -
+

Uses

+
    +
  • BOOST_PP_WHILE()
  • +
*/ #define BOOST_PP_LIST_FOLD_LEFT(F,P,L) BOOST_PP_LIST_FOLD_LEFT_D(0,F,P,L) diff --git a/include/boost/preprocessor/list/fold_right.hpp b/include/boost/preprocessor/list/fold_right.hpp index 1eb8643..3433389 100644 --- a/include/boost/preprocessor/list/fold_right.hpp +++ b/include/boost/preprocessor/list/fold_right.hpp @@ -15,17 +15,12 @@ #include -/**

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

+/**

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,

+

In other words, expands to:

-
-  BOOST_PP_LIST_FOLD_RIGHT(F,L,P)
-
- -

expands to:

- -
+
   F
   ( D
   , BOOST_PP_LIST_AT(L,0)
@@ -39,17 +34,12 @@
           )
         ) ...
   )
-
+
-

See

-
    -
  • BOOST_PP_LIST_FOLD_LEFT() -
- -

Uses

-
    -
  • BOOST_PP_WHILE() -
+

Uses

+
    +
  • BOOST_PP_LIST_FOLD_LEFT()
  • +
*/ #define BOOST_PP_LIST_FOLD_RIGHT(F,L,P) BOOST_PP_LIST_FOLD_RIGHT_D(0,F,L,P) diff --git a/include/boost/preprocessor/list/for_each.hpp b/include/boost/preprocessor/list/for_each.hpp index d5d0d9f..f7c4cbb 100644 --- a/include/boost/preprocessor/list/for_each.hpp +++ b/include/boost/preprocessor/list/for_each.hpp @@ -16,26 +16,27 @@ #include #include -/**

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

+/**

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:

+

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

Example

- +

Example

+ -

Uses

-
    -
  • BOOST_PP_FOR() -
+

Uses

+
    +
  • BOOST_PP_FOR()
  • +
*/ #define BOOST_PP_LIST_FOR_EACH(F,P,L) BOOST_PP_LIST_FOR_EACH_R(0,F,P,L) diff --git a/include/boost/preprocessor/list/for_each_product.hpp b/include/boost/preprocessor/list/for_each_product.hpp index 75fef01..7423b29 100644 --- a/include/boost/preprocessor/list/for_each_product.hpp +++ b/include/boost/preprocessor/list/for_each_product.hpp @@ -16,29 +16,31 @@ #include #include -/**

THIS IS NOT YET FULLY DOCUMENTED - DO NOT USE!

+/**

THIS IS NOT YET FULLY DOCUMENTED - DO NOT USE!

-

Repeats F(R,P,X) for each element X of the cartesian product of the lists LL.

+

Repeats F(R,P,X) for each element X of the +cartesian product of the lists LL.

-

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

+

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

-

Legend

-
    -
  • LL is a list of lists. -
  • X is a list of the elements of an element of the cartesian product of - the lists LL. -
+

Legend

+
    +
  • LL is a list of lists.
  • +
  • X is a list of the elements of an element of the cartesian product + of the lists LL.
  • +
-

Example

- +

Example

+ -

Uses

-
    -
  • BOOST_PP_FOR() -
+

Uses

+
    +
  • BOOST_PP_FOR()
  • +
*/ #define BOOST_PP_LIST_FOR_EACH_PRODUCT(F,P,LL) BOOST_PP_LIST_FOR_EACH_PRODUCT_R(0,F,P,LL) diff --git a/include/boost/preprocessor/list/rest_n.hpp b/include/boost/preprocessor/list/rest_n.hpp index 7bcc935..32341bd 100644 --- a/include/boost/preprocessor/list/rest_n.hpp +++ b/include/boost/preprocessor/list/rest_n.hpp @@ -17,20 +17,30 @@ #include #include -/**

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

+/**

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

-

For example,

+

For example,

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

expands to a list containing * and /.

+

expands to the same as:

-

Uses

-
    -
  • BOOST_PP_WHILE() -
+
+  BOOST_PP_TUPLE_TO_LIST(2,(*,/))
+
+ +

See

+
    +
  • BOOST_PP_LIST_FIRST_N()
  • +
+ +

Uses

+
    +
  • BOOST_PP_WHILE()
  • +
*/ #define BOOST_PP_LIST_REST_N(N,L) BOOST_PP_LIST_REST_N_D(0,N,L) diff --git a/include/boost/preprocessor/list/reverse.hpp b/include/boost/preprocessor/list/reverse.hpp index b6150b0..2e6ee53 100644 --- a/include/boost/preprocessor/list/reverse.hpp +++ b/include/boost/preprocessor/list/reverse.hpp @@ -15,20 +15,24 @@ #include -/**

List reversal.

+/**

List reversal.

-

For example,

+

For example,

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

expands to a list containing C, B and A.

+

expands to the same as:

-

Uses

-
    -
  • BOOST_PP_WHILE() -
+
+  BOOST_PP_TUPLE_TO_LIST(3,(C,B,A))
+
+ +

Uses

+
    +
  • BOOST_PP_LIST_FOLD_LEFT()
  • +
*/ #define BOOST_PP_LIST_REVERSE(L) BOOST_PP_LIST_REVERSE_D(0,L) diff --git a/include/boost/preprocessor/list/size.hpp b/include/boost/preprocessor/list/size.hpp index f94cfe1..5078bd6 100644 --- a/include/boost/preprocessor/list/size.hpp +++ b/include/boost/preprocessor/list/size.hpp @@ -16,20 +16,20 @@ #include #include -/**

Expands to the number of elements in the list.

+/**

Expands to the number of elements in the list.

-

For example,

+

For example,

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

expands to 3.

+

expands to 3.

-

Uses

-
    -
  • BOOST_PP_WHILE() -
+

Uses

+
    +
  • BOOST_PP_LIST_FOLD_LEFT()
  • +
*/ #define BOOST_PP_LIST_SIZE(L) BOOST_PP_LIST_SIZE_D(0,L) diff --git a/include/boost/preprocessor/list/to_tuple.hpp b/include/boost/preprocessor/list/to_tuple.hpp index 4cbfb83..4436a06 100644 --- a/include/boost/preprocessor/list/to_tuple.hpp +++ b/include/boost/preprocessor/list/to_tuple.hpp @@ -16,26 +16,26 @@ #include #include -/**

Converts the list to a tuple.

+/**

Converts the list to a tuple.

-

For example,

+

For example,

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

expands to (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.

    -
+

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.
  • +
-

Uses

-
    -
  • BOOST_PP_FOR() -
+

Uses

+
    +
  • BOOST_PP_LIST_FOR_EACH()
  • +
*/ #define BOOST_PP_LIST_TO_TUPLE(L) BOOST_PP_LIST_TO_TUPLE_R(0,L) diff --git a/include/boost/preprocessor/list/transform.hpp b/include/boost/preprocessor/list/transform.hpp index 1751028..9345fd1 100644 --- a/include/boost/preprocessor/list/transform.hpp +++ b/include/boost/preprocessor/list/transform.hpp @@ -15,30 +15,35 @@ #include -/**

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

+/**

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:

+

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

For example,

+

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.

+

expands to the same as:

-

Uses

-
    -
  • BOOST_PP_WHILE() -
+
+  BOOST_PP_TUPLE_TO_LIST(2,(3,4))
+
+ +

Uses

+
    +
  • BOOST_PP_LIST_FOLD_RIGHT()
  • +
*/ #define BOOST_PP_LIST_TRANSFORM(F,P,L) BOOST_PP_LIST_TRANSFORM_D(0,F,P,L) diff --git a/include/boost/preprocessor/logical.hpp b/include/boost/preprocessor/logical.hpp index daf8aa1..e6b08a7 100644 --- a/include/boost/preprocessor/logical.hpp +++ b/include/boost/preprocessor/logical.hpp @@ -13,7 +13,7 @@ * See http://www.boost.org for most recent version. */ -/**

Includes all logical headers.

*/ +/**

Includes all logical headers.

*/ #include #include diff --git a/include/boost/preprocessor/logical/and.hpp b/include/boost/preprocessor/logical/and.hpp index 3928675..59fd22f 100644 --- a/include/boost/preprocessor/logical/and.hpp +++ b/include/boost/preprocessor/logical/and.hpp @@ -15,12 +15,12 @@ #include -/**

Expands to the logical AND of the operands.

+/**

Expands to the logical AND of the operands.

-

For example, BOOST_PP_AND(0,5) expands to 0 (a single token).

+

For example, BOOST_PP_AND(0,5) expands to 0 (a single token).

*/ #define BOOST_PP_AND(X,Y) BOOST_PP_NOR(BOOST_PP_NOT(X),BOOST_PP_NOT(Y)) -/**

Obsolete. Use BOOST_PP_AND().

*/ +/**

Obsolete. Use BOOST_PP_AND().

*/ #define BOOST_PREPROCESSOR_AND(X,Y) BOOST_PP_AND(X,Y) #endif diff --git a/include/boost/preprocessor/logical/bool.hpp b/include/boost/preprocessor/logical/bool.hpp index cb12e0d..7e5d5ba 100644 --- a/include/boost/preprocessor/logical/bool.hpp +++ b/include/boost/preprocessor/logical/bool.hpp @@ -13,7 +13,7 @@ * See http://www.boost.org for most recent version. */ -/**

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

*/ +/**

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

*/ #define BOOST_PP_BOOL(X) BOOST_PP_BOOL_DELAY(X) #ifndef DOXYGEN_SHOULD_SKIP_THIS @@ -152,6 +152,6 @@ #define BOOST_PP_BOOL128 1 #endif -/**

Obsolete. Use BOOST_PP_BOOL().

*/ +/**

Obsolete. Use BOOST_PP_BOOL().

*/ #define BOOST_PREPROCESSOR_BOOL(X) BOOST_PP_BOOL(X) #endif diff --git a/include/boost/preprocessor/logical/nor.hpp b/include/boost/preprocessor/logical/nor.hpp index 8994f74..0895a36 100644 --- a/include/boost/preprocessor/logical/nor.hpp +++ b/include/boost/preprocessor/logical/nor.hpp @@ -15,9 +15,9 @@ #include -/**

Expands to the logical NEITHER OR of the operands.

+/**

Expands to the logical NEITHER OR of the operands.

-

For example, BOOST_PP_NOR(0,5) expands to 0 (a single token).

+

For example, BOOST_PP_NOR(0,5) expands to 0 (a single token).

*/ #define BOOST_PP_NOR(X,Y) BOOST_PP_NOR_BOOL(BOOST_PP_BOOL(X),BOOST_PP_BOOL(Y)) @@ -30,6 +30,6 @@ #define BOOST_PP_NOR_BOOL11 0 #endif -/**

Obsolete. Use BOOST_PP_NOR().

*/ +/**

Obsolete. Use BOOST_PP_NOR().

*/ #define BOOST_PREPROCESSOR_NOR(X,Y) BOOST_PP_NOR(X,Y) #endif diff --git a/include/boost/preprocessor/logical/not.hpp b/include/boost/preprocessor/logical/not.hpp index 22e1e2f..b279d90 100644 --- a/include/boost/preprocessor/logical/not.hpp +++ b/include/boost/preprocessor/logical/not.hpp @@ -15,12 +15,12 @@ #include -/**

Expands to the logical NOT of the operand.

+/**

Expands to the logical NOT of the operand.

-

For example, BOOST_PP_NOT(0) expands to 1 (a single token).

+

For example, BOOST_PP_NOT(0) expands to 1 (a single token).

*/ #define BOOST_PP_NOT(X) BOOST_PP_NOR(X,X) -/**

Obsolete. Use BOOST_PP_NOT().

*/ +/**

Obsolete. Use BOOST_PP_NOT().

*/ #define BOOST_PREPROCESSOR_NOT(X) BOOST_PP_NOT(X) #endif diff --git a/include/boost/preprocessor/logical/or.hpp b/include/boost/preprocessor/logical/or.hpp index 064178f..d3a6aff 100644 --- a/include/boost/preprocessor/logical/or.hpp +++ b/include/boost/preprocessor/logical/or.hpp @@ -15,12 +15,12 @@ #include -/**

Expands to the logical OR of the operands.

+/**

Expands to the logical OR of the operands.

-

For example, BOOST_PP_OR(0,2) expands to 1 (a single token).

+

For example, BOOST_PP_OR(0,2) expands to 1 (a single token).

*/ #define BOOST_PP_OR(X,Y) BOOST_PP_NOT(BOOST_PP_NOR(X,Y)) -/**

Obsolete. Use BOOST_PP_OR().

*/ +/**

Obsolete. Use BOOST_PP_OR().

*/ #define BOOST_PREPROCESSOR_OR(X,Y) BOOST_PP_OR(X,Y) #endif diff --git a/include/boost/preprocessor/logical/xor.hpp b/include/boost/preprocessor/logical/xor.hpp index 767d052..1f08dcf 100644 --- a/include/boost/preprocessor/logical/xor.hpp +++ b/include/boost/preprocessor/logical/xor.hpp @@ -15,12 +15,12 @@ #include -/**

Expands to the logical EXCLUSIVE OR of the operands.

+/**

Expands to the logical EXCLUSIVE OR of the operands.

-

For example, BOOST_PP_XOR(1,2) expands to 0 (a single token).

+

For example, BOOST_PP_XOR(1,2) expands to 0 (a single token).

*/ #define BOOST_PP_XOR(X,Y) BOOST_PP_NOR(BOOST_PP_NOR(X,Y),BOOST_PP_AND(X,Y)) -/**

Obsolete. Use BOOST_PP_XOR().

*/ +/**

Obsolete. Use BOOST_PP_XOR().

*/ #define BOOST_PREPROCESSOR_XOR(X,Y) BOOST_PP_XOR(X,Y) #endif diff --git a/include/boost/preprocessor/max.hpp b/include/boost/preprocessor/max.hpp index e4cabc4..f95eb3a 100644 --- a/include/boost/preprocessor/max.hpp +++ b/include/boost/preprocessor/max.hpp @@ -16,14 +16,15 @@ #include #include -/**

Expands to the maximum of X and Y.

+/**

Expands to the maximum of X and Y.

-

For example, BOOST_PP_MAX(5,7) expands to 7 (a single token).

+

For example, BOOST_PP_MAX(5,7) expands to 7 (a +single token).

-

Uses

-
    -
  • BOOST_PP_WHILE() -
+

Uses

+
    +
  • BOOST_PP_WHILE()
  • +
*/ #define BOOST_PP_MAX(X,Y) BOOST_PP_MAX_D(0,X,Y) @@ -31,6 +32,6 @@ #define BOOST_PP_MAX_D(D,X,Y) BOOST_PP_IF(BOOST_PP_LESS_EQUAL_D(D,X,Y),Y,X) #endif -/**

Obsolete. Use BOOST_PP_MAX().

*/ +/**

Obsolete. Use BOOST_PP_MAX().

*/ #define BOOST_PREPROCESSOR_MAX(X,Y) BOOST_PP_MAX(X,Y) #endif diff --git a/include/boost/preprocessor/min.hpp b/include/boost/preprocessor/min.hpp index a66ad54..69387d0 100644 --- a/include/boost/preprocessor/min.hpp +++ b/include/boost/preprocessor/min.hpp @@ -16,14 +16,15 @@ #include #include -/**

Expands to the minimum of X and Y.

+/**

Expands to the minimum of X and Y.

-

For example, BOOST_PP_MIN(5,7) expands to 5 (a single token).

+

For example, BOOST_PP_MIN(5,7) expands to 5 (a +single token).

-

Uses

-
    -
  • BOOST_PP_WHILE() -
+

Uses

+
    +
  • BOOST_PP_WHILE()
  • +
*/ #define BOOST_PP_MIN(X,Y) BOOST_PP_MIN_D(0,X,Y) @@ -31,6 +32,6 @@ #define BOOST_PP_MIN_D(D,X,Y) BOOST_PP_IF(BOOST_PP_LESS_EQUAL_D(D,Y,X),Y,X) #endif -/**

Obsolete. Use BOOST_PP_MIN().

*/ +/**

Obsolete. Use BOOST_PP_MIN().

*/ #define BOOST_PREPROCESSOR_MIN(X,Y) BOOST_PP_MIN(X,Y) #endif diff --git a/include/boost/preprocessor/repeat.hpp b/include/boost/preprocessor/repeat.hpp index fa95bcf..e034cc6 100644 --- a/include/boost/preprocessor/repeat.hpp +++ b/include/boost/preprocessor/repeat.hpp @@ -13,29 +13,29 @@ * See http://www.boost.org for most recent version. */ -/**

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

+/**

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

-

In other words, expands to the sequence:

+

In other words, expands to the sequence:

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

2D and 3D repetition

+

2D and 3D repetition

-

2D and 3D repetition are supported with the BOOST_PP_REPEAT_2ND() and -BOOST_PP_REPEAT_3RD() macros.

+

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

-

Example

- +

Example

+ -

See

-
    -
  • BOOST_PP_FOR() -
  • BOOST_PP_LIMIT_MAG -
+

See

+
    +
  • BOOST_PP_FOR()
  • +
  • BOOST_PP_LIMIT_MAG
  • +
*/ #define BOOST_PP_REPEAT(N,M,P) BOOST_PP_REPEAT_DELAY(N,M,P) @@ -172,6 +172,6 @@ BOOST_PP_REPEAT_3RD() macros.

#define BOOST_PP_REPEAT128(M,P) BOOST_PP_REPEAT127(M,P) M(127,P) #endif -/**

Obsolete. Use BOOST_PP_REPEAT().

*/ +/**

Obsolete. Use BOOST_PP_REPEAT().

*/ #define BOOST_PREPROCESSOR_REPEAT(N,M,P) BOOST_PP_REPEAT(N,M,P) #endif diff --git a/include/boost/preprocessor/repeat_2nd.hpp b/include/boost/preprocessor/repeat_2nd.hpp index b273d5d..f7d64bf 100644 --- a/include/boost/preprocessor/repeat_2nd.hpp +++ b/include/boost/preprocessor/repeat_2nd.hpp @@ -13,7 +13,7 @@ * See http://www.boost.org for most recent version. */ -/**

Same as BOOST_PP_REPEAT(), but implemented independently.

*/ +/**

Same as BOOST_PP_REPEAT(), but implemented independently.

*/ #define BOOST_PP_REPEAT_2ND(N,M,P) BOOST_PP_REPEAT_2ND_DELAY(N,M,P) #ifndef DOXYGEN_SHOULD_SKIP_THIS @@ -149,6 +149,6 @@ #define BOOST_PP_REPEAT_2ND128(M,P) BOOST_PP_REPEAT_2ND127(M,P) M(127,P) #endif -/**

Obsolete. Use BOOST_PP_REPEAT_2ND().

*/ +/**

Obsolete. Use BOOST_PP_REPEAT_2ND().

*/ #define BOOST_PREPROCESSOR_REPEAT_2ND(N,M,P) BOOST_PP_REPEAT_2ND(N,M,P) #endif diff --git a/include/boost/preprocessor/repeat_3rd.hpp b/include/boost/preprocessor/repeat_3rd.hpp index 98a5a18..29e7116 100644 --- a/include/boost/preprocessor/repeat_3rd.hpp +++ b/include/boost/preprocessor/repeat_3rd.hpp @@ -13,7 +13,7 @@ * See http://www.boost.org for most recent version. */ -/**

Same as BOOST_PP_REPEAT(), but implemented independently.

*/ +/**

Same as BOOST_PP_REPEAT(), but implemented independently.

*/ #define BOOST_PP_REPEAT_3RD(N,M,P) BOOST_PP_REPEAT_3RD_DELAY(N,M,P) #ifndef DOXYGEN_SHOULD_SKIP_THIS @@ -149,6 +149,6 @@ #define BOOST_PP_REPEAT_3RD128(M,P) BOOST_PP_REPEAT_3RD127(M,P) M(127,P) #endif -/**

Obsolete. Use BOOST_PP_REPEAT_3RD().

*/ +/**

Obsolete. Use BOOST_PP_REPEAT_3RD().

*/ #define BOOST_PREPROCESSOR_REPEAT_3RD(N,M,P) BOOST_PP_REPEAT_3RD(N,M,P) #endif diff --git a/include/boost/preprocessor/stringize.hpp b/include/boost/preprocessor/stringize.hpp index e31b0f3..7b0ec00 100644 --- a/include/boost/preprocessor/stringize.hpp +++ b/include/boost/preprocessor/stringize.hpp @@ -13,32 +13,12 @@ * See http://www.boost.org for most recent version. */ -/**

Delays the stringization of X.

+/**

Stringizes X after it is macro expanded.

-

For example,

- -
-  #define NOTE(STR)\
-    message(__FILE__ "(" BOOST_PP_STRINGIZE(__LINE__) ") : " STR)
-
-  // ...
-
-  #pragma NOTE("TBD!")
-
- -

expands to:

- -
-  #pragma message("examples.cpp" "(" "20" ") : " "TBD!")
-
- -

The use of BOOST_PP_STRINGIZE() above lets the PP expand the __LINE__ -before stringizing it. If # would be used directly, the code would -expand to:

- -
-  #pragma message("examples.cpp" "(" "__LINE__" ") : " "TBD!")
-
+

Example

+ */ #define BOOST_PP_STRINGIZE(X) BOOST_PP_STRINGIZE_DELAY(X) @@ -47,6 +27,6 @@ expand to:

#define BOOST_PP_DO_STRINGIZE(X) #X #endif -/**

Obsolete. Use BOOST_PP_STRINGIZE().

*/ +/**

Obsolete. Use BOOST_PP_STRINGIZE().

*/ #define BOOST_PREPROCESSOR_STRINGIZE(E) BOOST_PP_STRINGIZE(E) #endif diff --git a/include/boost/preprocessor/tuple.hpp b/include/boost/preprocessor/tuple.hpp index cac67d0..0253df5 100644 --- a/include/boost/preprocessor/tuple.hpp +++ b/include/boost/preprocessor/tuple.hpp @@ -13,7 +13,7 @@ * See http://www.boost.org for most recent version. */ -/**

Includes all tuple headers.

*/ +/**

Includes all tuple headers.

*/ #include #include diff --git a/include/boost/preprocessor/tuple/eat.hpp b/include/boost/preprocessor/tuple/eat.hpp index b0337fc..f5cbb7c 100644 --- a/include/boost/preprocessor/tuple/eat.hpp +++ b/include/boost/preprocessor/tuple/eat.hpp @@ -13,18 +13,18 @@ * 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 length.

-

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

+

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

expands to nothing.

+

expands to nothing.

*/ #define BOOST_PP_TUPLE_EAT(N) BOOST_PP_TUPLE_EAT_DELAY(N) diff --git a/include/boost/preprocessor/tuple/elem.hpp b/include/boost/preprocessor/tuple/elem.hpp index 329926b..8e25e53 100644 --- a/include/boost/preprocessor/tuple/elem.hpp +++ b/include/boost/preprocessor/tuple/elem.hpp @@ -13,30 +13,30 @@ * See http://www.boost.org for most recent version. */ -/**

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

+/**

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

-

For example,

+

For example,

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

expands to B.

+

expands to B.

-

Tuples can be used for representing structured data.

+

Tuples can be used for representing structured data.

-

Examples of tuples:

+

Examples of tuples:

-
+
   2-tuple: (A, B)
   3-tuple: (1, 2, 3)
   4-tuple: (A B C, D, EF, 34)
-
+
-

See

-
    -
  • BOOST_PP_LIMIT_TUPLE -
+

See

+
    +
  • BOOST_PP_LIMIT_TUPLE
  • +
*/ #define BOOST_PP_TUPLE_ELEM(N,I,T) BOOST_PP_TUPLE_ELEM_DELAY(N,I,T) @@ -212,6 +212,6 @@ #define BOOST_PP_TUPLE16_ELEM15(A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P) P #endif -/**

Obsolete. Use BOOST_PP_TUPLE_ELEM().

*/ +/**

Obsolete. Use BOOST_PP_TUPLE_ELEM().

*/ #define BOOST_PREPROCESSOR_TUPLE_ELEM(N,I,T) BOOST_PP_TUPLE_ELEM(N,I,T) #endif diff --git a/include/boost/preprocessor/tuple/to_list.hpp b/include/boost/preprocessor/tuple/to_list.hpp index 9004cf6..b9df7c2 100644 --- a/include/boost/preprocessor/tuple/to_list.hpp +++ b/include/boost/preprocessor/tuple/to_list.hpp @@ -15,27 +15,27 @@ #include -/**

Converts a tuple to a list.

+/**

Converts a tuple to a list.

-

For example,

+

For example,

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

expands to the same as

+

expands to the same as

-
+
   BOOST_PP_LIST_CONS(A,
   BOOST_PP_LIST_CONS(B,
   BOOST_PP_LIST_CONS(C,
   BOOST_PP_LIST_NIL)))
-
+
-

See

-
    -
  • BOOST_PP_LIMIT_TUPLE -
+

See

+
    +
  • BOOST_PP_LIMIT_TUPLE
  • +
*/ #define BOOST_PP_TUPLE_TO_LIST(N,T) BOOST_PP_TUPLE_TO_LIST_DELAY(N,T) diff --git a/include/boost/preprocessor/while.hpp b/include/boost/preprocessor/while.hpp index 129bc3d..8fa8a9f 100644 --- a/include/boost/preprocessor/while.hpp +++ b/include/boost/preprocessor/while.hpp @@ -16,90 +16,48 @@ #include #include -/**

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

+/**

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

-

In other words, expands to:

+

In other words, expands to:

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

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

+

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

-

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 - 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. -
  • D is the recursion depth and should only be used as a parameter +

    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 + 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.
    • +
    • 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 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. -
    + C++ preprocessor.
  • +
-

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

+

Note

+
    +
  • The value of the D parameter may exceed BOOST_PP_LIMIT_MAG.
  • +
  • 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.
  • +
-

Caveat

- -

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.

- -

Example

- - -

For a more complex example, let's take a look at an implementation of -BOOST_PP_MUL().

- -
-  #define BOOST_PP_MUL(X,Y) BOOST_PP_MUL_D(0,X,Y)
-  // Since the macro is implemented using WHILE, the actual implementation
-  // takes a depth as a parameter so that it can be called inside a WHILE.
-  // The above easy-to-use version simply uses 0 as the depth and can not be
-  // called inside a WHILE.
-
-  #define BOOST_PP_MUL_D(D,X,Y)\
-    BOOST_PP_TUPLE_ELEM(3,0,BOOST_PP_WHILE##D(BOOST_PP_MUL_C,BOOST_PP_MUL_F,(0,X,Y)))
-  //                    ^^^               ^^^             ^^             ^^ ^^^^^^^
-  //                    #1                #2              #3             #3 #1
-  //
-  // #1) The state is a 3-tuple. After the iteration is finished, the first
-  // element of the tuple is the result.
-  //
-  // #2) The WHILE primitive is "invoked" directly. BOOST_PP_WHILE(D,...)
-  // can't be used because it would not be expanded by the C++ preprocessor.
-  //
-  // #3) ???_C is the condition and ???_F is the iteration macro.
-
-  #define BOOST_PP_MUL_C(D,P)\
-    BOOST_PP_TUPLE_ELEM(3,2,P)
-  // Iteration is finished when the counter reaches 0.
-
-  #define BOOST_PP_MUL_F(D,P)\
-    ( BOOST_PP_ADD_D(D,BOOST_PP_TUPLE_ELEM(3,0,P),BOOST_PP_TUPLE_ELEM(3,1,P))\
-    , BOOST_PP_TUPLE_ELEM(3,1,P)\
-    , BOOST_PP_DEC(BOOST_PP_TUPLE_ELEM(3,2,P))\
-    )
-  // ( The result is increased by the multiplier.
-  // , The multiplier is retained without change.
-  // , The counter is decreased.
-  // )
-
- -

Implementation rationale

-
    -
  • The maximum iteration depth is greater than 2*BOOST_PP_LIMIT_MAG to make - it possible to compute N*N functions. -
+

Example

+ */ #define BOOST_PP_WHILE(C,F,X) BOOST_PP_WHILE_C(C(1,X),0,X)(C,F,F(1,X))