diff --git a/doc/keywords.txt b/doc/keywords.txt index 211cd4b..eedb1cb 100644 --- a/doc/keywords.txt +++ b/doc/keywords.txt @@ -93,6 +93,9 @@ BOOST_PP_OR BOOST_PP_REPEAT BOOST_PP_REPEAT_2ND BOOST_PP_REPEAT_3RD +BOOST_PP_REPEAT_FROM_TO +BOOST_PP_REPEAT_FROM_TO_2ND +BOOST_PP_REPEAT_FROM_TO_3RD BOOST_PP_STRINGIZE BOOST_PP_SUB BOOST_PP_SUB_D diff --git a/doc/reference/index.htm b/doc/reference/index.htm index 2980348..2ad44cd 100644 --- a/doc/reference/index.htm +++ b/doc/reference/index.htm @@ -116,6 +116,9 @@
Repeats the macro M(I,P)
for I = [0,N[.
Repeats the macro M(I,P)
for I = [0,N[
.
In other words, expands to the sequence:
diff --git a/doc/reference/repeat_3rd.htm b/doc/reference/repeat_3rd.htm index 87c7239..d100b26 100644 --- a/doc/reference/repeat_3rd.htm +++ b/doc/reference/repeat_3rd.htm @@ -19,7 +19,7 @@Obsolete. Use BOOST_PP_REPEAT_3RD().
Revised
diff --git a/doc/reference/repeat_from_to.htm b/doc/reference/repeat_from_to.htm new file mode 100644 index 0000000..b302ad8 --- /dev/null +++ b/doc/reference/repeat_from_to.htm @@ -0,0 +1,75 @@ + + + +
+ |
+
+ Boost.Preprocessor+Reference+ |
+
Repeats the macro M(I,P)
for I = [S,E[
.
In other words, expands to the sequence:
+ ++ M(S,P) M(BOOST_PP_INC(S),P) ... M(BOOST_PP_DEC(E),P) ++ +
For example,
+ ++ #define TEST(I,P) P(I); + BOOST_PP_REPEAT_FROM_TO(4,7,TEST,X) ++ +
expands to:
+ ++ X(4); X(5); X(6); ++ +
Revised
+ +© Copyright Housemarque Oy 2002
+ +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.
+ + diff --git a/doc/reference/repeat_from_to_2nd.htm b/doc/reference/repeat_from_to_2nd.htm new file mode 100644 index 0000000..419c7d6 --- /dev/null +++ b/doc/reference/repeat_from_to_2nd.htm @@ -0,0 +1,45 @@ + + + +
+ |
+
+ Boost.Preprocessor+Reference+ |
+
Same as BOOST_PP_REPEAT_FROM_TO(), but implemented independently.
+Revised
+ +© Copyright Housemarque Oy 2002
+ +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.
+ + diff --git a/doc/reference/repeat_from_to_3rd.htm b/doc/reference/repeat_from_to_3rd.htm new file mode 100644 index 0000000..c168f92 --- /dev/null +++ b/doc/reference/repeat_from_to_3rd.htm @@ -0,0 +1,45 @@ + + + +
+ |
+
+ Boost.Preprocessor+Reference+ |
+
Same as BOOST_PP_REPEAT_FROM_TO(), but implemented independently.
+Revised
+ +© Copyright Housemarque Oy 2002
+ +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.
+ + diff --git a/doc/reference/stringize.htm b/doc/reference/stringize.htm index 8832034..712cd64 100644 --- a/doc/reference/stringize.htm +++ b/doc/reference/stringize.htm @@ -19,7 +19,7 @@Obsolete. Use BOOST_PP_STRINGIZE().
Revised
diff --git a/include/boost/preprocessor.hpp b/include/boost/preprocessor.hpp index 6618583..cc09742 100644 --- a/include/boost/preprocessor.hpp +++ b/include/boost/preprocessor.hpp @@ -29,8 +29,8 @@ #includeRepeats the macro M(I,P)
for I = [0,N[.
Repeats the macro M(I,P)
for I = [0,N[
.
In other words, expands to the sequence:
diff --git a/include/boost/preprocessor/repeat_from_to.hpp b/include/boost/preprocessor/repeat_from_to.hpp new file mode 100644 index 0000000..00ec641 --- /dev/null +++ b/include/boost/preprocessor/repeat_from_to.hpp @@ -0,0 +1,53 @@ +#ifndef BOOST_PREPROCESSOR_REPEAT_FROM_TO_HPP +#define BOOST_PREPROCESSOR_REPEAT_FROM_TO_HPP + +/* Copyright (C) 2002 + * Housemarque Oy + * http://www.housemarque.com + * + * Permission to copy, use, modify, sell and distribute this software is + * granted provided this copyright notice appears in all copies. This + * software is provided "as is" without express or implied warranty, and + * with no claim as to its suitability for any purpose. + * + * See http://www.boost.org for most recent version. + */ + +#includeRepeats the macro M(I,P)
for I = [S,E[
.
In other words, expands to the sequence:
+ ++ M(S,P) M(BOOST_PP_INC(S),P) ... M(BOOST_PP_DEC(E),P) ++ +
For example,
+ ++ #define TEST(I,P) P(I); + BOOST_PP_REPEAT_FROM_TO(4,7,TEST,X) ++ +
expands to:
+ ++ X(4); X(5); X(6); ++ +
Same as BOOST_PP_REPEAT_FROM_TO(), but implemented independently.
*/ +#define BOOST_PP_REPEAT_FROM_TO_2ND(S,E,M,P) BOOST_PP_REPEAT_2ND(BOOST_PP_SUB(E,S),BOOST_PP_REPEAT_FROM_TO_2ND_F,(S,M,P)) +#define BOOST_PP_REPEAT_FROM_TO_2ND_F(I,SMP) BOOST_PP_TUPLE_ELEM(3,1,SMP)(BOOST_PP_ADD(I,BOOST_PP_TUPLE_ELEM(3,0,SMP)),BOOST_PP_TUPLE_ELEM(3,2,SMP)) +#endif diff --git a/include/boost/preprocessor/repeat_from_to_3rd.hpp b/include/boost/preprocessor/repeat_from_to_3rd.hpp new file mode 100644 index 0000000..cf5a0ac --- /dev/null +++ b/include/boost/preprocessor/repeat_from_to_3rd.hpp @@ -0,0 +1,23 @@ +#ifndef BOOST_PREPROCESSOR_REPEAT_FROM_TO_3RD_HPP +#define BOOST_PREPROCESSOR_REPEAT_FROM_TO_3RD_HPP + +/* Copyright (C) 2002 + * Housemarque Oy + * http://www.housemarque.com + * + * Permission to copy, use, modify, sell and distribute this software is + * granted provided this copyright notice appears in all copies. This + * software is provided "as is" without express or implied warranty, and + * with no claim as to its suitability for any purpose. + * + * See http://www.boost.org for most recent version. + */ + +#includeSame as BOOST_PP_REPEAT_FROM_TO(), but implemented independently.
*/ +#define BOOST_PP_REPEAT_FROM_TO_3RD(S,E,M,P) BOOST_PP_REPEAT_3RD(BOOST_PP_SUB(E,S),BOOST_PP_REPEAT_FROM_TO_3RD_F,(S,M,P)) +#define BOOST_PP_REPEAT_FROM_TO_3RD_F(I,SMP) BOOST_PP_TUPLE_ELEM(3,1,SMP)(BOOST_PP_ADD(I,BOOST_PP_TUPLE_ELEM(3,0,SMP)),BOOST_PP_TUPLE_ELEM(3,2,SMP)) +#endif diff --git a/test/repeat_test.cpp b/test/repeat_test.cpp index 99e56ea..6de24f2 100644 --- a/test/repeat_test.cpp +++ b/test/repeat_test.cpp @@ -14,6 +14,8 @@ #include