From 03b37c307fad4477eca0b66f790db86c772b796f Mon Sep 17 00:00:00 2001 From: Vesa Karvonen Date: Sun, 10 Mar 2002 12:31:37 +0000 Subject: [PATCH] Docs updated [SVN r13169] --- doc/reference/for.htm | 30 +++++++++---------- doc/reference/list_fold_left.htm | 13 ++++++++ doc/reference/list_fold_right.htm | 13 ++++++++ doc/reference/list_for_each.htm | 13 ++++++++ doc/reference/list_for_each_i.htm | 13 ++++++++ doc/reference/list_for_each_product.htm | 19 ++++++++++++ doc/reference/logical_bool.htm | 2 ++ doc/reference/repeat.htm | 13 ++++++++ doc/reference/stringize.htm | 2 ++ doc/reference/while.htm | 14 +++++++++ include/boost/preprocessor/for.hpp | 30 +++++++++---------- include/boost/preprocessor/list/fold_left.hpp | 2 +- .../boost/preprocessor/list/fold_right.hpp | 13 ++++++++ include/boost/preprocessor/list/for_each.hpp | 13 ++++++++ .../boost/preprocessor/list/for_each_i.hpp | 13 ++++++++ .../preprocessor/list/for_each_product.hpp | 19 ++++++++++++ include/boost/preprocessor/while.hpp | 14 +++++++++ 17 files changed, 205 insertions(+), 31 deletions(-) diff --git a/doc/reference/for.htm b/doc/reference/for.htm index 037a3fa..c585080 100644 --- a/doc/reference/for.htm +++ b/doc/reference/for.htm @@ -38,6 +38,21 @@

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

+

For example,

+ +
+  #define C(R,X) BOOST_PP_LESS(BOOST_PP_TUPLE_ELEM(2,0,X),BOOST_PP_TUPLE_ELEM(2,1,X))
+  #define F(R,X) (BOOST_PP_INC(BOOST_PP_TUPLE_ELEM(2,0,X)),BOOST_PP_TUPLE_ELEM(2,1,X))
+  #define I(R,X) BOOST_PP_TUPLE_ELEM(2,0,X)
+  BOOST_PP_FOR((0,3),C,F,I)
+
+ +

expands to:

+ +
+  0 1 2
+
+

Legend

-

For example,

- -
-  #define C(R,X) BOOST_PP_LESS(BOOST_PP_TUPLE_ELEM(2,0,X),BOOST_PP_TUPLE_ELEM(2,1,X))
-  #define F(R,X) (BOOST_PP_INC(BOOST_PP_TUPLE_ELEM(2,0,X)),BOOST_PP_TUPLE_ELEM(2,1,X))
-  #define I(R,X) BOOST_PP_TUPLE_ELEM(2,0,X)
-  BOOST_PP_FOR((0,3),C,F,I)
-
- -

expands to:

- -
-  0 1 2
-
-

BOOST_PP_REPEAT() vs BOOST_PP_FOR()

BOOST_PP_FOR() is a generalization of BOOST_PP_REPEAT(). This means that diff --git a/doc/reference/list_fold_left.htm b/doc/reference/list_fold_left.htm index 2b2f1c2..ca987de 100644 --- a/doc/reference/list_fold_left.htm +++ b/doc/reference/list_fold_left.htm @@ -40,6 +40,19 @@ list L (from the left or the start of the list).

) +

For example,

+ +
+  #define TEST(D,P,X) BOOST_PP_CAT(P,X)
+  BOOST_PP_LIST_FOLD_LEFT(TEST,_,BOOST_PP_TUPLE_TO_LIST(3,(A,B,C)))
+
+ +

expands to:

+ +
+  _ABC
+
+

Note