diff --git a/doc/acknowledgements.htm b/doc/acknowledgements.htm deleted file mode 100644 index 38c8977..0000000 --- a/doc/acknowledgements.htm +++ /dev/null @@ -1,43 +0,0 @@ - -
- - -
- |
-
- Boost.Preprocessor-Acknowledgements- |
-
The original idea of passing two extra parameters to REPEAT, which makes it - possible to create preprocessor code on top of it, was due to Aleksey Gurtovoy. - The invokeable IDENTITY macro was also invented by him. He also suggested the - name for the library. Many thanks to Aleksey for his insights!
-Thanks to everyone who participated in the review: David Abrahams, Beman Dawes, - Ronald Garcia, Douglas Gregor, Aleksey Gurtovoy, Jeremy Siek, and Daryle Walker.
-Thanks to Chris Little and Mat Marcus for providing help with MWCW.
-The original automatic recursion technique, which makes many of the library -primitives easier to use, was invented by Paul Mensonides.
-The PREPROCESSOR library has been developed by Vesa Karvonen.
-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/bibliography.htm b/doc/bibliography.htm deleted file mode 100644 index 44082e5..0000000 --- a/doc/bibliography.htm +++ /dev/null @@ -1,48 +0,0 @@ - - - - -
- |
-
- Boost.Preprocessor-Bibliography- |
-
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/examples.htm b/doc/examples.htm deleted file mode 100644 index a4e93a7..0000000 --- a/doc/examples.htm +++ /dev/null @@ -1,91 +0,0 @@ - - - - -
- |
-
- Boost.Preprocessor-Examples- |
-
array_arithmetic.c | Implements over 2200 functions for 1-dimensional arithmetic -array manipulation in C. The idea is to use preprocessor data structures, -lists and tuples, for storing metainformation to be used for generating -the actual C code. |
catch_builtin.cpp | -Demonstrates the usage of lists and BOOST_PP_LIST_FOR_EACH(). | -
count_down.c | -Trivial example of using BOOST_PP_WHILE() that simply counts - down from N to 0 ultimately expanding to a 0. | -
delay.c | -Implements a macro whose expansion takes exponential amount - of time. | -
duffs_device.c | -Uses the preprocessor library to implement a generalized - macro for implementing a Duff's Device. | -
is_integral.cpp | -Demonstrates the usage of preprocessor lists for generating - C++ code. | -
linear_fib.c | -Shows how BOOST_PP_WHILE() can be used for implementing macros. | -
note.c | -Shows how BOOST_PP_STRINGIZE() can be used to allow macro - expansion before stringization. | -
repeat_2d.c | -Implements a generalized macro for 2D repetition using the - simple repetition primitives of the preprocessor library. | -
static_assert.c | -Shows how BOOST_PP_CAT() can be used to allow macro expansion - before token concatenation. | -
subscript_layer.cpp | -Shows how BOOST_PP_EMPTY can be used as an unused or empty - parameter. | -
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/examples/array_arithmetic.c b/doc/examples/array_arithmetic.c new file mode 100644 index 0000000..91c6717 --- /dev/null +++ b/doc/examples/array_arithmetic.c @@ -0,0 +1,197 @@ +# /* 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. +# */ +# +# /* Revised by Paul Mensonides (2002) */ +# +# /* See http://www.boost.org for most recent version. */ +# +# /* This example implements over 2200 functions for 1-dimensional arithmetic +# * array manipulation in C. The idea is to use preprocessor data structures, +# * lists, and tuples for storing metainformation to be used for generating +# * the actual C code. +# * +# * Who needs templates anyway? :) +# * +# * Compile with any C compiler with a standards conforming preprocessor. +# */ +# +# include
- |
-
- Boost.Preprocessor-Tutorial examples preprocessed- |
-
The following code snippets were produced by actually preprocessing the code - snippets of the tutorial. After preprocessing the code was reformatted manually.
- -EXAMPLE: - Use a Local Macro to avoid small scale repetition
- -template<class T, int n> -vec<T,n>& - operator += - ( vec<T,n>& - lhs - , const vec<T,n>& - rhs - ) -{ for (int i=0; i<n; ++i) - lhs(i) += rhs(i); - return lhs; -} - -template<class T, int n> -vec<T,n>& - operator -= - ( vec<T,n>& - lhs - , const vec<T,n>& - rhs - ) -{ for (int i=0; i<n; ++i) - lhs(i) -= rhs(i); - return lhs; -} - -template<class T, int n> -vec<T,n>& - operator *= - ( vec<T,n>& - lhs - , const vec<T,n>& - rhs - ) -{ for (int i=0; i<n; ++i) - lhs(i) *= rhs(i); - return lhs; -} - -template<class T, int n> -vec<T,n>& - operator /= - ( vec<T,n>& - lhs - , const vec<T,n>& - rhs - ) -{ for (int i=0; i<n; ++i) - lhs(i) /= rhs(i); - return lhs; -} -- -
EXAMPLE: - Use BOOST_PP_EMPTY() as an unused parameter in Local Macro instantiations
- -template<class base> -typename implement_subscript_using_begin_subscript<base>::value_type& - implement_subscript_using_begin_subscript<base>::operator[] - ( index_type - i - ) -{ return base::begin()[i]; -} - -template<class base> -const typename implement_subscript_using_begin_subscript<base>::value_type& - implement_subscript_using_begin_subscript<base>::operator[] - ( index_type - i - ) const -{ return base::begin()[i]; -} -- -
EXAMPLE: Use BOOST_PP_CAT instead of ## when necessary
- -enum -{ static_check_152 = (sizeof(int) <= sizeof(long)) ? 1 : -1 -}; -typedef char - static_assert_152 - [ static_check_152 - ]; --
EXAMPLE: Use BOOST_PP_STRINGIZE instead of # whenever necessary
-#pragma message("examples.cpp" "(" "20" ") : " "TBD!")-
EXAMPLE: - Use:
-to avoid O(N) repetition on lists in general
-struct make_type_list_end; - -template -< class T0=make_type_list_end -, class T1=make_type_list_end -, class T2=make_type_list_end -, class T3=make_type_list_end -, class T4=make_type_list_end -, class T5=make_type_list_end -, class T6=make_type_list_end -, class T7=make_type_list_end -> -struct make_type_list -{ -private: - enum - { end = is_same<T0,make_type_list_end>::value - }; -public: - typedef typename - type_if - < end - , type_cons_empty - , type_cons - < T0 - , typename - type_inner_if - < end - , type_identity<end> - , make_type_list - < T1 - , T2 - , T3 - , T4 - , T5 - , T6 - , T7 - > - >::type - > - >::type type; -}; -- -
EXAMPLE: - Use BOOST_PP_REPEAT and a Token Look-Up Function to eliminate categorical - repetition
- -catch (bool t) -{ report_typeid(t); - report_value(t); -} -catch (char t) -{ report_typeid(t); - report_value(t); -} -catch (signed char t) -{ report_typeid(t); - report_value(t); -} -catch (unsigned char t) -{ report_typeid(t); - report_value(t); -} -catch (short t) -{ report_typeid(t); - report_value(t); -} -catch (unsigned short t) -{ report_typeid(t); - report_value(t); -} -catch (int t) -{ report_typeid(t); - report_value(t); -} -catch (unsigned int t) -{ report_typeid(t); - report_value(t); -} -catch (long t) -{ report_typeid(t); - report_value(t); -} -catch (unsigned long t) -{ report_typeid(t); - report_value(t); -} -catch (float t) -{ report_typeid(t); - report_value(t); -} -catch (double t) -{ report_typeid(t); - report_value(t); -} -catch (long double t) -{ report_typeid(t); - report_value(t); -} -- -
EXAMPLE: - Use BOOST_PP_REPEAT_2ND to avoid O(N*N) repetition
- -vec() -{ -} -vec(T a0) -{ (*this)[0] = a0; -} -vec(T a0, T a1) -{ (*this)[0] = a0; - (*this)[1] = a1; -} -vec(T a0, T a1, T a2) -{ (*this)[0] = a0; - (*this)[1] = a1; - (*this)[2] = a2; -} -vec(T a0, T a1, T a2, T a3) -{ (*this)[0] = a0; - (*this)[1] = a1; - (*this)[2] = a2; - (*this)[3] = a3; -} -vec(T a0, T a1, T a2, T a3, T a4) -{ (*this)[0] = a0; - (*this)[1] = a1; - (*this)[2] = a2; - (*this)[3] = a3; - (*this)[4] = a4; -} -vec(T a0, T a1, T a2, T a3, T a4, T a5) -{ (*this)[0] = a0; - (*this)[1] = a1; - (*this)[2] = a2; - (*this)[3] = a3; - (*this)[4] = a4; - (*this)[5] = a5; -} -vec(T a0, T a1, T a2, T a3, T a4, T a5, T a6) -{ (*this)[0] = a0; - (*this)[1] = a1; - (*this)[2] = a2; - (*this)[3] = a3; - (*this)[4] = a4; - (*this)[5] = a5; - (*this)[6] = a6; -} -vec(T a0, T a1, T a2, T a3, T a4, T a5, T a6, T a7) -{ (*this)[0] = a0; - (*this)[1] = a1; - (*this)[2] = a2; - (*this)[3] = a3; - (*this)[4] = a4; - (*this)[5] = a5; - (*this)[6] = a6; - (*this)[7] = a7; -} -- -
-
EXAMPLE: - Use BOOST_PP_IF to implement special case for the first element
- -false == false; -true == true; -- -
-
EXAMPLE: Use arithmetic, logical and comparison operations when necessary
- -S, E0, E1 -E0, S, E1 -E0, E1, S -BAD PARAMS FOR SPECIAL_NUMBERED_LIST! E0, E1, E2, S- -
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/index.htm b/doc/index.htm deleted file mode 100644 index 41eb4e2..0000000 --- a/doc/index.htm +++ /dev/null @@ -1,48 +0,0 @@ - - - - -
- |
-
- Boost.Preprocessor-Index- |
-
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/keywords.txt b/doc/keywords.txt deleted file mode 100644 index 47568fd..0000000 --- a/doc/keywords.txt +++ /dev/null @@ -1,99 +0,0 @@ -BOOST_PP_ADD -BOOST_PP_ADD_D -BOOST_PP_AND -BOOST_PP_ASSERT_MSG -BOOST_PP_BOOL -BOOST_PP_CAT -BOOST_PP_COMMA -BOOST_PP_COMMA_IF -BOOST_PP_DEC -BOOST_PP_DIV -BOOST_PP_DIV_D -BOOST_PP_EMPTY -BOOST_PP_ENUM -BOOST_PP_ENUM_PARAMS -BOOST_PP_ENUM_PARAMS_WITH_A_DEFAULT -BOOST_PP_ENUM_PARAMS_WITH_DEFAULTS -BOOST_PP_ENUM_SHIFTED -BOOST_PP_ENUM_SHIFTED_PARAMS -BOOST_PP_EQUAL -BOOST_PP_EQUAL_D -BOOST_PP_EXPAND -BOOST_PP_EXPR_IF -BOOST_PP_FOR -BOOST_PP_GREATER -BOOST_PP_GREATER_D -BOOST_PP_GREATER_EQUAL -BOOST_PP_GREATER_EQUAL_D -BOOST_PP_IDENTITY -BOOST_PP_IF -BOOST_PP_INC -BOOST_PP_LESS -BOOST_PP_LESS_D -BOOST_PP_LESS_EQUAL -BOOST_PP_LESS_EQUAL_D -BOOST_PP_LIMIT_DIM -BOOST_PP_LIMIT_MAG -BOOST_PP_LIMIT_TUPLE -BOOST_PP_LIST_APPEND -BOOST_PP_LIST_APPEND_D -BOOST_PP_LIST_AT -BOOST_PP_LIST_AT_D -BOOST_PP_LIST_CAT -BOOST_PP_LIST_CAT_D -BOOST_PP_LIST_CONS -BOOST_PP_LIST_ENUM -BOOST_PP_LIST_ENUM_R -BOOST_PP_LIST_FILTER -BOOST_PP_LIST_FILTER_D -BOOST_PP_LIST_FIRST -BOOST_PP_LIST_FIRST_N -BOOST_PP_LIST_FIRST_N_D -BOOST_PP_LIST_FOLD_LEFT -BOOST_PP_LIST_FOLD_LEFT_D -BOOST_PP_LIST_FOLD_RIGHT -BOOST_PP_LIST_FOLD_RIGHT_D -BOOST_PP_LIST_FOR_EACH -BOOST_PP_LIST_FOR_EACH_I -BOOST_PP_LIST_FOR_EACH_I_R -BOOST_PP_LIST_FOR_EACH_R -BOOST_PP_LIST_FOR_EACH_PRODUCT -BOOST_PP_LIST_FOR_EACH_PRODUCT_R -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_REST_N_D -BOOST_PP_LIST_REVERSE -BOOST_PP_LIST_REVERSE_D -BOOST_PP_LIST_SIZE -BOOST_PP_LIST_SIZE_D -BOOST_PP_LIST_TO_TUPLE -BOOST_PP_LIST_TO_TUPLE_R -BOOST_PP_LIST_TRANSFORM -BOOST_PP_LIST_TRANSFORM_D -BOOST_PP_MAX -BOOST_PP_MAX_D -BOOST_PP_MIN -BOOST_PP_MIN_D -BOOST_PP_MOD -BOOST_PP_MOD_D -BOOST_PP_MUL -BOOST_PP_MUL_D -BOOST_PP_NOR -BOOST_PP_NOT -BOOST_PP_NOT_EQUAL -BOOST_PP_NOT_EQUAL_D -BOOST_PP_OR -BOOST_PP_REPEAT -BOOST_PP_REPEAT_FROM_TO -BOOST_PP_STRINGIZE -BOOST_PP_SUB -BOOST_PP_SUB_D -BOOST_PP_TUPLE_EAT -BOOST_PP_TUPLE_ELEM -BOOST_PP_TUPLE_REVERSE -BOOST_PP_TUPLE_TO_LIST -BOOST_PP_WHILE -BOOST_PP_XOR diff --git a/doc/known_problems_with_cpp.htm b/doc/known_problems_with_cpp.htm deleted file mode 100644 index c1d13e7..0000000 --- a/doc/known_problems_with_cpp.htm +++ /dev/null @@ -1,125 +0,0 @@ - - - - -
- |
-
- Boost.Preprocessor-Widely known problems with the C preprocessor- |
-
Preprocessor metaprogramming is subject to heated discussions. Part of this is caused by -bad experiences with dangerous techniques, such as defining inline functions using macros. As a rule -of thumb, if you can find a clean and -manageable way to do something without using the preprocessor, then -you should do it that way.
- -Let's survey some of the widely known problems with the preprocessor in a problem/solution - format.
-PROBLEM: Preprocessor does not -respect scope, therefore macros can accidentally and sometimes silently replace -code.
- -SOLUTION A: Use all caps identifiers -for macros and only macros. This practically eliminates the possibility that a -macro might replace other kind of code accidentally.
- -SOLUTION B: Use the Local Macro -idiom:
- -#define MACRO ... -// Use MACRO -#undef MACRO -- -
This makes sure that a macro can not accidentally -replace code outside of the scope of the local macro.
-A problem with this solution is that the #undef can not be automated and may be -forgotten. Experienced programmers generally write the #undef either immediately -before (in time) or immediately after writing the macro definition.
-SOLUTION C: Use the Unique Macro Prefix idiom:
- -#define UMP_MACRO -// Use UMP_MACRO -- - -
This makes accidental substitution and collisions highly -unlikely. Problems with this solution:
-By combining all solutions, whenever -possible, the scope problem can be largely avoided.
-PROBLEM: Preprocessor code is difficult to read. -It requires understanding the basic process of how -the preprocessor recursively expands macros, finding the macro definition and mentally -substituting the parameters of the macro.
-SOLUTION: Any kind of programming requires basic understanding - of how the code is executed. Any parameterization technique, including simple - functions and templates requires finding the definition and mentally substituting - parameters.
-However, it is good to know a few techniques:
-An especially important thing to remember is to limit the use of preprocessor - to the structured, well understood and safe methods. Structure helps to understand - complex systems [McConnell].
-PROBLEM: "I'd -like to see Cpp abolished." - Bjarne Stroustrup in [Stroustrup]
-SOLUTION: The C preprocessor will be here for a -long time.
-In practice, preprocessor metaprogramming is far simpler and more portable - than template metaprogramming [Czarnecki].
-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/problems_with_compilers.htm b/doc/problems_with_compilers.htm deleted file mode 100644 index 03bc664..0000000 --- a/doc/problems_with_compilers.htm +++ /dev/null @@ -1,138 +0,0 @@ - - - - -
- |
-
- Boost.Preprocessor-Known problems with specific compilers- |
-
Some compilers have buggy or limited preprocessors. This page explains known - problems with specific compilers.
-Metrowerks Codewarrior 7.0 has a bug in preprocessor (to be more - concrete, in function-like macro replacement mechanism) that restricts usage - of the library to only very simple cases, at least if you don't write code that - specifically address this issue; for example, the above NUMBERED_EXPRESSION - example doesn't compile on CW 7.0. Below is a simple test case that reproduces - the bug:
- -#define IDENTITY_MACRO(x) IDENTITY_MACRO_BODY(x) -#define IDENTITY_MACRO_BODY(x) x -#define COMMA_TOKEN() , -int a IDENTITY_MACRO(COMMA_TOKEN)() b; // this works -int c IDENTITY_MACRO(IDENTITY_MACRO(COMMA_TOKEN))() d; // this doesn't -- -
Basically, what's happening here is that function-like COMMA_TOKEN macro gets - expanded _inside_ of the nested IDENTITY_MACRO call - even although it's NOT - followed by a '(' as the next preprocessing token - which is a clearly an incorrect - behavior (see 16.3 [cpp.replace] para 9 for the detailed description of the - function-like macro replacement process). I've submitted a bug report, but they - haven't confirmed it yet.
-So, this is not a problem of the library, but probably something that needs - to be mentioned in the documentation, may be with some examples of how to workaround - the issue. Just to show one possible way around the problem, here is a NUMBERED_EXPRESSION - macro that does work on MWCW:
-#define NUMBERED_EXPRESSION(n, x) \ - BOOST_PP_CAT(BOOST_, \ - BOOST_PP_IF( \ - n \ - , PREPROCESSOR_IDENTITY(x##n) \ - , PREPROCESSOR_EMPTY \ - ))() \ -/**/ --
Reported by Aleksey Gurtovoy
- -It appears that their algorithm of macro call invocation is quite far - from ideal, because for the following code fragment (which is a part of - preprocessor_test.cpp), the - linear increasing of IS_FUNCTION_HELPER_TEST_MAX value leads to not even - quadratic, but something like exponential increasing of compilation time! - (see the timing data below). This behavior may or may not be problematic - for you, depending on how intense is your usage of the library. - -
#ifndef IS_FUNCTION_HELPER_TEST_MAX -#define IS_FUNCTION_HELPER_TEST_MAX 40 -#endif - -typedef char yes_type; - -#define IS_FUNCTION_HELPER(I,A)\ - template\ - <BOOST_PP_ENUM_PARAMS(BOOST_PP_INC(I),class P)>\ - yes_type is_function_helper(\ - P0 (*)(BOOST_PP_ENUM_SHIFTED_PARAMS(BOOST_PP_INC(I),P))); - -BOOST_PP_REPEAT_2ND(BOOST_PP_INC(IS_FUNCTION_HELPER_TEST_MAX),IS_FUNCTION_HELPER,A) - -#undef IS_FUNCTION_HELPER -- -
- | Comeau C/C++ 4.2.45.2 | -Microsoft Visual C++ 6.0 SP5 | -
---|---|---|
10 parameters | -< 1 sec | -< 1 sec | -
20 parameters | -~ 2 sec | -< 1 sec | -
30 parameters | -~ 15 sec | -< 1 sec | -
40 parameters | -~ 50 sec | -< 1 sec | -
Reported by Aleksey Gurtovoy
- -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/arithmetic.htm b/doc/reference/arithmetic.htm deleted file mode 100644 index 448f451..0000000 --- a/doc/reference/arithmetic.htm +++ /dev/null @@ -1,41 +0,0 @@ - - - - -
- |
-
- Boost.Preprocessor-Header <boost/preprocessor/arithmetic.hpp>- |
-
Includes all arithmetic headers.
-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/arithmetic_add.htm b/doc/reference/arithmetic_add.htm deleted file mode 100644 index 126a817..0000000 --- a/doc/reference/arithmetic_add.htm +++ /dev/null @@ -1,59 +0,0 @@ - - - - -
- |
-
- Boost.Preprocessor-Header <boost/preprocessor/arithmetic/add.hpp>- |
-
Expands to the sum of X
and Y
.
Both X
and Y
must expand to integer literals
-in the range [0, BOOST_PP_LIMIT_MAG].
For example, BOOST_PP_ADD(4,3)
expands to 7
(a
-single token).
Can be used inside BOOST_PP_WHILE() (see for an explanation of the D parameter).
-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/arithmetic_div.htm b/doc/reference/arithmetic_div.htm deleted file mode 100644 index 120eba5..0000000 --- a/doc/reference/arithmetic_div.htm +++ /dev/null @@ -1,59 +0,0 @@ - - - - -
- |
-
- Boost.Preprocessor-Header <boost/preprocessor/arithmetic/div.hpp>- |
-
Expands to the quotient of X
and Y
.
Both X
and Y
must expand to integer literals
-in the range [0, BOOST_PP_LIMIT_MAG].
For example, BOOST_PP_DIV(4,3)
expands to 1
(a
-single token).
Can be used inside BOOST_PP_WHILE() (see for an explanation of the D parameter).
-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/arithmetic_mod.htm b/doc/reference/arithmetic_mod.htm deleted file mode 100644 index 68c6a3a..0000000 --- a/doc/reference/arithmetic_mod.htm +++ /dev/null @@ -1,59 +0,0 @@ - - - - -
- |
-
- Boost.Preprocessor-Header <boost/preprocessor/arithmetic/mod.hpp>- |
-
Expands to the remainder of X
and Y
.
Both X
and Y
must expand to integer literals
-in the range [0, BOOST_PP_LIMIT_MAG].
For example, BOOST_PP_MOD(4,3)
expands to 1
(a
-single token).
Can be used inside BOOST_PP_WHILE() (see for an explanation of the D parameter).
-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/arithmetic_mul.htm b/doc/reference/arithmetic_mul.htm deleted file mode 100644 index 4799c0d..0000000 --- a/doc/reference/arithmetic_mul.htm +++ /dev/null @@ -1,59 +0,0 @@ - - - - -
- |
-
- Boost.Preprocessor-Header <boost/preprocessor/arithmetic/mul.hpp>- |
-
Expands to the product of X
and Y
.
Both X
and Y
must expand to integer literals
-in the range [0, BOOST_PP_LIMIT_MAG].
For example, BOOST_PP_MUL(4,3)
expands to 12
(a
-single token).
Can be used inside BOOST_PP_WHILE() (see for an explanation of the D parameter).
-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/arithmetic_sub.htm b/doc/reference/arithmetic_sub.htm deleted file mode 100644 index 9ff9b41..0000000 --- a/doc/reference/arithmetic_sub.htm +++ /dev/null @@ -1,59 +0,0 @@ - - - - -
- |
-
- Boost.Preprocessor-Header <boost/preprocessor/arithmetic/sub.hpp>- |
-
Expands to the difference of X
and Y
.
Both X
and Y
must expand to integer literals
-in the range [0, BOOST_PP_LIMIT_MAG].
For example, BOOST_PP_SUB(4,3)
expands to 1
(a
-single token).
Can be used inside BOOST_PP_WHILE() (see for an explanation of the D parameter).
-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/assert_msg.htm b/doc/reference/assert_msg.htm deleted file mode 100644 index 4eade5f..0000000 --- a/doc/reference/assert_msg.htm +++ /dev/null @@ -1,49 +0,0 @@ - - - - -
- |
-
- Boost.Preprocessor-Header <boost/preprocessor/assert_msg.hpp>- |
-
Expands to nothing if COND != 0
and to MSG
if
-COND == 0
.
COND
must expand to an integer literal in the range [0, BOOST_PP_LIMIT_MAG].
For example, BOOST_PP_ASSERT_MSG(1,A BUG!)
expands to A BUG!
.
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/cat.htm b/doc/reference/cat.htm deleted file mode 100644 index 65c794c..0000000 --- a/doc/reference/cat.htm +++ /dev/null @@ -1,57 +0,0 @@ - - - - -
- |
-
- Boost.Preprocessor-Header <boost/preprocessor/cat.hpp>- |
-
Concatenates X
and Y
after they are macro
-expanded.
For example, BOOST_PP_CAT(A,BOOST_PP_CAT(_,B))
expands to A_B
.
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/comma.htm b/doc/reference/comma.htm deleted file mode 100644 index 305d98d..0000000 --- a/doc/reference/comma.htm +++ /dev/null @@ -1,60 +0,0 @@ - - - - -
- |
-
- Boost.Preprocessor-Header <boost/preprocessor/comma.hpp>- |
-
Expands to a comma.
- -Commas need special handling in preprocessor code, because commas are used -for separating macro parameters.
- -For example,
- --BOOST_PP_IF(1,BOOST_PP_COMMA,BOOST_PP_EMPTY)() -- -
expands to a comma.
- -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/comma_if.htm b/doc/reference/comma_if.htm deleted file mode 100644 index 4f6e587..0000000 --- a/doc/reference/comma_if.htm +++ /dev/null @@ -1,49 +0,0 @@ - - - - -
- |
-
- Boost.Preprocessor-Header <boost/preprocessor/comma_if.hpp>- |
-
Expands to a comma if COND != 0
and nothing if
-COND == 0
.
COND
must expand to an integer literal in the range [0, BOOST_PP_LIMIT_MAG].
For example, BOOST_PP_COMMA_IF(0)
expands to nothing.
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/comparison.htm b/doc/reference/comparison.htm deleted file mode 100644 index 6978b7b..0000000 --- a/doc/reference/comparison.htm +++ /dev/null @@ -1,41 +0,0 @@ - - - - -
- |
-
- Boost.Preprocessor-Header <boost/preprocessor/comparison.hpp>- |
-
Includes all comparison headers.
-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/comparison_equal.htm b/doc/reference/comparison_equal.htm deleted file mode 100644 index abb12c1..0000000 --- a/doc/reference/comparison_equal.htm +++ /dev/null @@ -1,59 +0,0 @@ - - - - -
- |
-
- Boost.Preprocessor-Header <boost/preprocessor/comparison/equal.hpp>- |
-
Expands to 1
if X == Y
and 0
-otherwise.
Both X
and Y
must expand to integer literals
-in the range [0, BOOST_PP_LIMIT_MAG].
For example, BOOST_PP_EQUAL(4,4)
expands to 1
.
Can be used inside BOOST_PP_WHILE() (see for an explanation of the D parameter).
-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/comparison_greater.htm b/doc/reference/comparison_greater.htm deleted file mode 100644 index 7cfa4c2..0000000 --- a/doc/reference/comparison_greater.htm +++ /dev/null @@ -1,59 +0,0 @@ - - - - -
- |
-
- Boost.Preprocessor-Header <boost/preprocessor/comparison/greater.hpp>- |
-
Expands to 1
if X > Y
and 0
-otherwise.
Both X
and Y
must expand to integer literals
-in the range [0, BOOST_PP_LIMIT_MAG].
For example, BOOST_PP_GREATER(4,3)
expands to 1
.
Can be used inside BOOST_PP_WHILE() (see for an explanation of the D parameter).
-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/comparison_greater_equal.htm b/doc/reference/comparison_greater_equal.htm deleted file mode 100644 index 084d356..0000000 --- a/doc/reference/comparison_greater_equal.htm +++ /dev/null @@ -1,59 +0,0 @@ - - - - -
- |
-
- Boost.Preprocessor-Header <boost/preprocessor/comparison/greater_equal.hpp>- |
-
Expands to 1
if X >= Y
and 0
-otherwise.
Both X
and Y
must expand to integer literals
-in the range [0, BOOST_PP_LIMIT_MAG].
For example, BOOST_PP_GREATER_EQUAL(1,3)
expands to 0
.
Can be used inside BOOST_PP_WHILE() (see for an explanation of the D parameter).
-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/comparison_less.htm b/doc/reference/comparison_less.htm deleted file mode 100644 index fab9f37..0000000 --- a/doc/reference/comparison_less.htm +++ /dev/null @@ -1,59 +0,0 @@ - - - - -
- |
-
- Boost.Preprocessor-Header <boost/preprocessor/comparison/less.hpp>- |
-
Expands to 1
if X < Y
and 0
-otherwise.
Both X
and Y
must expand to integer literals
-in the range [0, BOOST_PP_LIMIT_MAG].
For example, BOOST_PP_LESS(2,6)
expands to 1
.
Can be used inside BOOST_PP_WHILE() (see for an explanation of the D parameter).
-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/comparison_less_equal.htm b/doc/reference/comparison_less_equal.htm deleted file mode 100644 index 6267779..0000000 --- a/doc/reference/comparison_less_equal.htm +++ /dev/null @@ -1,59 +0,0 @@ - - - - -
- |
-
- Boost.Preprocessor-Header <boost/preprocessor/comparison/less_equal.hpp>- |
-
Expands to 1
if X <= Y
and 0
-otherwise.
Both X
and Y
must expand to integer literals
-in the range [0, BOOST_PP_LIMIT_MAG].
For example, BOOST_PP_LESS_EQUAL(7,5)
expands to 0
.
Can be used inside BOOST_PP_WHILE() (see for an explanation of the D parameter).
-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/comparison_not_equal.htm b/doc/reference/comparison_not_equal.htm deleted file mode 100644 index 3ab7d6b..0000000 --- a/doc/reference/comparison_not_equal.htm +++ /dev/null @@ -1,59 +0,0 @@ - - - - -
- |
-
- Boost.Preprocessor-Header <boost/preprocessor/comparison/not_equal.hpp>- |
-
Expands to 1
if X != Y
and 0
-otherwise.
Both X
and Y
must expand to integer literals
-in the range [0, BOOST_PP_LIMIT_MAG].
For example, BOOST_PP_NOT_EQUAL(4,4)
expands to 0
.
Can be used inside BOOST_PP_WHILE() (see for an explanation of the D parameter).
-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/dec.htm b/doc/reference/dec.htm deleted file mode 100644 index d8e309a..0000000 --- a/doc/reference/dec.htm +++ /dev/null @@ -1,52 +0,0 @@ - - - - -
- |
-
- Boost.Preprocessor-Header <boost/preprocessor/dec.hpp>- |
-
Decrements X
expanding to 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.
- -Only decimal integer literals in the range [0,BOOST_PP_LIMIT_MAG] are -supported.
- -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/empty.htm b/doc/reference/empty.htm deleted file mode 100644 index fc14256..0000000 --- a/doc/reference/empty.htm +++ /dev/null @@ -1,62 +0,0 @@ - - - - -
- |
-
- Boost.Preprocessor-Header <boost/preprocessor/empty.hpp>- |
-
Expands to nothing.
- -For example,
- --BOOST_PP_IF(0,BOOST_PP_COMMA,BOOST_PP_EMPTY)() -- -
expands to nothing.
- -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/enum.htm b/doc/reference/enum.htm deleted file mode 100644 index e89bcb6..0000000 --- a/doc/reference/enum.htm +++ /dev/null @@ -1,81 +0,0 @@ - - - - -
- |
-
- Boost.Preprocessor-Header <boost/preprocessor/enum.hpp>- |
-
Generates a comma separated list.
- -In other words, expands to the sequence:
- --MACRO(0,DATA), MACRO(1,DATA), ..., MACRO(BOOST_PP_DEC(COUNT),DATA) -- -
For example,
- --#define TYPED_PARAM(INDEX,DATA)\ - BOOST_PP_CAT(BOOST_PP_TUPLE_ELEM(2,0,DATA),INDEX) BOOST_PP_CAT(BOOST_PP_TUPLE_ELEM(2,1,DATA),INDEX) -BOOST_PP_ENUM(3,TYPED_PARAM,(X,x)) -- -
expands to:
- --X0 x0, X1 x1, X2 x2 -- -
BOOST_PP_ENUM() implements automatic recursion. 2D and 3D repetition -are directly supported.
- -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/enum_params.htm b/doc/reference/enum_params.htm deleted file mode 100644 index a257eba..0000000 --- a/doc/reference/enum_params.htm +++ /dev/null @@ -1,72 +0,0 @@ - - - - -
- |
-
- Boost.Preprocessor-Header <boost/preprocessor/enum_params.hpp>- |
-
Generates a comma separated list of parameters.
- -In other words, expands to the sequence:
- --BOOST_PP_CAT(PARAM,0), BOOST_PP_CAT(PARAM,1), ..., BOOST_PP_CAT(PARAM,BOOST_PP_DEC(COUNT)) -- -
For example,
- --BOOST_PP_ENUM_PARAMS(3,x) -- -
expands to:
- --x0, x1, x2 -- -
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/enum_params_with_a_default.htm b/doc/reference/enum_params_with_a_default.htm deleted file mode 100644 index 8d10a14..0000000 --- a/doc/reference/enum_params_with_a_default.htm +++ /dev/null @@ -1,75 +0,0 @@ - - - - -
- |
-
- Boost.Preprocessor-Header <boost/preprocessor/enum_params_with_a_default.hpp>- |
-
Generates a comma separated list of parameters with a default.
- -In other words, expands to the sequence:
- --BOOST_PP_CAT(PARAM,0) = DEFAULT, -BOOST_PP_CAT(PARAM,1) = DEFAULT, -..., -BOOST_PP_CAT(PARAM,BOOST_PP_DEC(COUNT)) = DEFAULT -- -
For example,
- --BOOST_PP_ENUM_PARAMS_WITH_A_DEFAULT(3,x,y) -- -
expands to:
- --x0 = y, x1 = y, x2 = y -- -
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/enum_params_with_defaults.htm b/doc/reference/enum_params_with_defaults.htm deleted file mode 100644 index a635190..0000000 --- a/doc/reference/enum_params_with_defaults.htm +++ /dev/null @@ -1,75 +0,0 @@ - - - - -
- |
-
- Boost.Preprocessor-Header <boost/preprocessor/enum_params_with_defaults.hpp>- |
-
Generates a comma separated list of parameters with defaults.
- -In other words, expands to the sequence:
- --BOOST_PP_CAT(PARAM,0) = BOOST_PP_CAT(DEFAULT,0), -BOOST_PP_CAT(PARAM,1) = BOOST_PP_CAT(DEFAULT,1), -..., -BOOST_PP_CAT(PARAM,BOOST_PP_DEC(COUNT)) = BOOST_PP_CAT(DEFAULT,BOOST_PP_DEC(COUNT)) -- -
For example,
- --BOOST_PP_ENUM_PARAMS_WITH_DEFAULTS(3,x,y) -- -
expands to:
- --x0 = y0, x1 = y1, x2 = y2 -- -
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/enum_shifted.htm b/doc/reference/enum_shifted.htm deleted file mode 100644 index 61b51a0..0000000 --- a/doc/reference/enum_shifted.htm +++ /dev/null @@ -1,69 +0,0 @@ - - - - -
- |
-
- Boost.Preprocessor-Header <boost/preprocessor/enum_shifted.hpp>- |
-
Generates a comma separated shifted list.
- -In other words, expands to the sequence:
- --MACRO(1,DATA), MACRO(2,DATA), ..., MACRO(BOOST_PP_DEC(COUNT),DATA) -- -
For example,
- --#define TYPED_PARAM(INDEX,DATA)\ - BOOST_PP_CAT(BOOST_PP_TUPLE_ELEM(2,0,DATA),INDEX) BOOST_PP_CAT(BOOST_PP_TUPLE_ELEM(2,1,DATA),INDEX) -BOOST_PP_ENUM_SHIFTED(3,TYPED_PARAM,(X,x)) -- -
expands to:
- --X1 x1, X2 x2 -- -
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/enum_shifted_params.htm b/doc/reference/enum_shifted_params.htm deleted file mode 100644 index 33679ff..0000000 --- a/doc/reference/enum_shifted_params.htm +++ /dev/null @@ -1,77 +0,0 @@ - - - - -
- |
-
- Boost.Preprocessor-Header <boost/preprocessor/enum_shifted_params.hpp>- |
-
Generates a comma separated list of shifted actual parameters.
- -In other words, expands to the sequence:
- --BOOST_PP_CAT(PARAM,1), BOOST_PP_CAT(PARAM,2), ..., BOOST_PP_CAT(PARAM,BOOST_PP_DEC(COUNT)) --
For example,
- --BOOST_PP_ENUM_SHIFTED_PARAMS(3,x) -- -
expands to:
- --x1, x2 -- -
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/expand.htm b/doc/reference/expand.htm deleted file mode 100644 index 306f2da..0000000 --- a/doc/reference/expand.htm +++ /dev/null @@ -1,43 +0,0 @@ - - - - -
- |
-
- Boost.Preprocessor-Header <boost/preprocessor/expand.hpp>- |
-
Essentially macro expands the parameter X
twice.
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/expr_if.htm b/doc/reference/expr_if.htm deleted file mode 100644 index 541f234..0000000 --- a/doc/reference/expr_if.htm +++ /dev/null @@ -1,53 +0,0 @@ - - - - -
- |
-
- Boost.Preprocessor-Header <boost/preprocessor/expr_if.hpp>- |
-
Expands to EXPR
if COND != 0
and to nothing if COND == 0
.
COND
must expand to an integer literal in the range [0, BOOST_PP_LIMIT_MAG].
For example, BOOST_PP_EXPR_IF(1,^)
expands to ^
.
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/for.htm b/doc/reference/for.htm deleted file mode 100644 index 84bd48d..0000000 --- a/doc/reference/for.htm +++ /dev/null @@ -1,114 +0,0 @@ - - - - -
- |
-
- Boost.Preprocessor-Header <boost/preprocessor/for.hpp>- |
-
Repeats MACRO(R,STATE)
and iterates OP(R,STATE)
while
-PRED(R,STATE)
is true.
In other words, expands to the sequence:
- --MACRO(R,STATE) -MACRO(R,OP(R,STATE)) -MACRO(R,OP(R,OP(R,STATE))) -... -MACRO(R,OP(R,OP(...OP(R,STATE)...))) -- -
The length of the sequence is determined by PRED(R,STATE)
.
For example,
- --#define PRED(R,STATE) BOOST_PP_LESS(BOOST_PP_TUPLE_ELEM(2,0,STATE),BOOST_PP_TUPLE_ELEM(2,1,STATE)) -#define OP(R,STATE) (BOOST_PP_INC(BOOST_PP_TUPLE_ELEM(2,0,STATE)),BOOST_PP_TUPLE_ELEM(2,1,STATE)) -#define MACRO(R,STATE) BOOST_PP_TUPLE_ELEM(2,0,STATE) -BOOST_PP_FOR((0,3),PRED,OP,MACRO) -- -
expands to:
- --0 1 2 -- -
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.
- -BOOST_PP_FOR() can be used for multidimensional repetition simply by -invoking BOOST_PP_FOR##R() directly.
- -BOOST_PP_FOR() currently does not implement automatic recursion. The reason -for this is that it would lead to very poor performance. The automatic recursion -technique takes O(N) steps just to find out that the Nth recursion should be used. -This would dramatically effect the time complexity of macros using automatic -recursion.
- -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/identity.htm b/doc/reference/identity.htm deleted file mode 100644 index 32a28a0..0000000 --- a/doc/reference/identity.htm +++ /dev/null @@ -1,64 +0,0 @@ - - - - -
- |
-
- Boost.Preprocessor-Header <boost/preprocessor/identity.hpp>- |
-
Expands to X
once invoked.
Designed to be used with BOOST_PP_IF(), when one of the clauses need to be -invoked.
- -For example,
- --BOOST_PP_IF(1,BOOST_PP_IDENTITY(X),BOOST_PP_EMPTY)() -- -
expands to:
- --X -- -
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/if.htm b/doc/reference/if.htm deleted file mode 100644 index b2ceb31..0000000 --- a/doc/reference/if.htm +++ /dev/null @@ -1,59 +0,0 @@ - - - - -
- |
-
- Boost.Preprocessor-Header <boost/preprocessor/if.hpp>- |
-
Expands to THEN
if COND != 0
and ELSE
if
-COND == 0
.
COND
must expand to an integer literal in the range [0, BOOST_PP_LIMIT_MAG].
For example, BOOST_PP_IF(0,1,2)
expands to 2
.
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/inc.htm b/doc/reference/inc.htm deleted file mode 100644 index 90b2e4b..0000000 --- a/doc/reference/inc.htm +++ /dev/null @@ -1,53 +0,0 @@ - - - - -
- |
-
- Boost.Preprocessor-Header <boost/preprocessor/inc.hpp>- |
-
Increments X
expanding to 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.
- -Only decimal integer literals in the range [0,BOOST_PP_LIMIT_MAG] are -supported.
- -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/index.htm b/doc/reference/index.htm deleted file mode 100644 index 599ae7e..0000000 --- a/doc/reference/index.htm +++ /dev/null @@ -1,225 +0,0 @@ - - - - -
- |
-
- Boost.Preprocessor-Reference- |
-
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/limits.htm b/doc/reference/limits.htm deleted file mode 100644 index c07528c..0000000 --- a/doc/reference/limits.htm +++ /dev/null @@ -1,71 +0,0 @@ - - - - -
- |
-
- Boost.Preprocessor-Header <boost/preprocessor/limits.hpp>- |
-
Expands to the number of dimensions of repeat supported by the -library.
- -This concerns the repetition primitives (BOOST_PP_ENUM(), -BOOST_PP_REPEAT() and BOOST_PP_REPEAT_FROM_TO()).
- -Expands to the maximum straight numeric literal supported by the -library.
- -This is also the limit of the repetition primitives (BOOST_PP_ENUM(), -BOOST_PP_REPEAT() and BOOST_PP_REPEAT_FROM_TO()).
- -Expands to the maximum tuple size supported by the library.
-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/list.htm b/doc/reference/list.htm deleted file mode 100644 index 3e93239..0000000 --- a/doc/reference/list.htm +++ /dev/null @@ -1,53 +0,0 @@ - - - - -
- |
-
- Boost.Preprocessor-Header <boost/preprocessor/list.hpp>- |
-
Includes all list headers.
- -A list is an arbitrary size collection of elements.
- -In the preprocessor library, the internal representation of lists -uses parts that are like macro parameter lists. Thus an element of a list -can be any sequence of tokens that constitutes a single macro parameter.
- -Lists are manipulated using both list ADT macros and higher-order macros. For an introduction to manipulation of lists in functional programming, see -[Thompson], -[Abelson] or -[Cousineau].
- -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/list_adt.htm b/doc/reference/list_adt.htm deleted file mode 100644 index fa3e37f..0000000 --- a/doc/reference/list_adt.htm +++ /dev/null @@ -1,135 +0,0 @@ - - - - -
- |
-
- Boost.Preprocessor-Header <boost/preprocessor/list/adt.hpp>- |
-
This header defines the fundamental list operations.
- -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.
- -Longer lists can be built from short lists with BOOST_PP_LIST_APPEND_D() -and BOOST_PP_LIST_FOLD_RIGHT():
- --BOOST_PP_LIST_FOLD_RIGHT -( BOOST_PP_LIST_APPEND_D -, BOOST_PP_TUPLE_TO_LIST - ( N - , BOOST_PP_TUPLE_TO_LIST(M, (E11, E12, ..., E1M) ) - , BOOST_PP_TUPLE_TO_LIST(M, (E21, E22, ..., E2M) ) - , ... - , BOOST_PP_TUPLE_TO_LIST(M, (EN1, EN2, ..., ENM) ) - ) -, BOOST_PP_LIST_NIL -) -- -
List nil constructor.
-Expands to 1 if the list is not nil and 0 otherwise.
-Expands to 1 if the list is nil and 0 otherwise.
-Expands to the first element of the list. The list must not be nil.
- -For example,
- --BOOST_PP_LIST_FIRST(BOOST_PP_TUPLE_TO_LIST(5,(1,2,3,4,5))) -- -
expands to 1.
- -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 the same as:
- --BOOST_PP_TUPLE_TO_LIST(4,(2,3,4,5)) -- -
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/list_append.htm b/doc/reference/list_append.htm deleted file mode 100644 index a51caef..0000000 --- a/doc/reference/list_append.htm +++ /dev/null @@ -1,68 +0,0 @@ - - - - -
- |
-
- Boost.Preprocessor-Header <boost/preprocessor/list/append.hpp>- |
-
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)) -) -- -
expands to the same as:
- --BOOST_PP_TUPLE_TO_LIST(4,(1,2,3,4)) -- -
Can be used inside BOOST_PP_WHILE() (see for an explanation of the D parameter).
-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/list_at.htm b/doc/reference/list_at.htm deleted file mode 100644 index 1a92d1d..0000000 --- a/doc/reference/list_at.htm +++ /dev/null @@ -1,62 +0,0 @@ - - - - -
- |
-
- Boost.Preprocessor-Header <boost/preprocessor/list/at.hpp>- |
-
Expands to the INDEX
:th element of the list LIST
. 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
.
Can be used inside BOOST_PP_WHILE() (see for an explanation of the D parameter).
-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/list_cat.htm b/doc/reference/list_cat.htm deleted file mode 100644 index c85d5b4..0000000 --- a/doc/reference/list_cat.htm +++ /dev/null @@ -1,65 +0,0 @@ - - - - -
- |
-
- Boost.Preprocessor-Header <boost/preprocessor/list/cat.hpp>- |
-
Catenates all elements of the list.
- -For example,
- --BOOST_PP_LIST_CAT(BOOST_PP_TUPLE_TO_LIST(3,(1,2,3))) -- -
expands to:
- --123 -- -
Can be used inside BOOST_PP_WHILE() (see for an explanation of the D parameter).
-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/list_enum.htm b/doc/reference/list_enum.htm deleted file mode 100644 index 0d41483..0000000 --- a/doc/reference/list_enum.htm +++ /dev/null @@ -1,65 +0,0 @@ - - - - -
- |
-
- Boost.Preprocessor-Header <boost/preprocessor/list/enum.hpp>- |
-
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 -- -
Can be used inside BOOST_PP_FOR() (see for an explanation of the R parameter).
-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/list_filter.htm b/doc/reference/list_filter.htm deleted file mode 100644 index d8b0d53..0000000 --- a/doc/reference/list_filter.htm +++ /dev/null @@ -1,66 +0,0 @@ - - - - -
- |
-
- Boost.Preprocessor-Header <boost/preprocessor/list/filter.hpp>- |
-
Expands to a list containing all the elements X
of the list
-for which PRED(D,DATA,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 the same as:
- --BOOST_PP_TUPLE_TO_LIST(2,(1,3)) -- -
Can be used inside BOOST_PP_WHILE() (see for an explanation of the D parameter).
-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/list_first_n.htm b/doc/reference/list_first_n.htm deleted file mode 100644 index 572f10e..0000000 --- a/doc/reference/list_first_n.htm +++ /dev/null @@ -1,71 +0,0 @@ - - - - -
- |
-
- Boost.Preprocessor-Header <boost/preprocessor/list/first_n.hpp>- |
-
Expands to a list of the first COUNT
elements of the list
-LIST
.
For example,
- --BOOST_PP_LIST_FIRST_N(2,BOOST_PP_TUPLE_TO_LIST(4,(+,-,*,/))) -- -
expands to the same as:
- --BOOST_PP_TUPLE_TO_LIST(2,(+,-)) -- -
Can be used inside BOOST_PP_WHILE() (see for an explanation the D parameter).
-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/list_fold_left.htm b/doc/reference/list_fold_left.htm deleted file mode 100644 index 6c893b0..0000000 --- a/doc/reference/list_fold_left.htm +++ /dev/null @@ -1,103 +0,0 @@ - - - - -
- |
-
- Boost.Preprocessor-Header <boost/preprocessor/list/fold_left.hpp>- |
-
Iterates OP(D,STATE,X)
for each element X
of the
-list LIST
(from the left or the start of the list).
In other words, expands to:
- --OP -( D -, ... OP(D, OP(D,STATE,BOOST_PP_LIST_AT(LIST,0)), BOOST_PP_LIST_AT(LIST,1)) ... -, BOOST_PP_LIST_AT(LIST,BOOST_PP_DEC(BOOST_PP_LIST_SIZE(LIST)) -) -- -
For example,
- --#define TEST(D,STATE,X) BOOST_PP_CAT(STATE,X) -BOOST_PP_LIST_FOLD_LEFT(TEST,_,BOOST_PP_TUPLE_TO_LIST(3,(A,B,C))) -- -
expands to:
- --_ABC -- -
Can be used inside BOOST_PP_WHILE() (see for an explanation of the D parameter).
- -Obsolete, just use BOOST_PP_LIST_FOLD_LEFT().
-Obsolete, just use BOOST_PP_LIST_FOLD_LEFT_D().
-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/list_fold_left_2nd.htm b/doc/reference/list_fold_left_2nd.htm deleted file mode 100644 index 27f2a96..0000000 --- a/doc/reference/list_fold_left_2nd.htm +++ /dev/null @@ -1,46 +0,0 @@ - - - - -
- |
-
- Boost.Preprocessor-Header <boost/preprocessor/list/fold_left_2nd.hpp>- |
-
This header is obsolete. Use the following code instead.
- --#include <boost/preprocessor/list/fold_left.hpp> -- -
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/list_fold_right.htm b/doc/reference/list_fold_right.htm deleted file mode 100644 index 5c0fe4c..0000000 --- a/doc/reference/list_fold_right.htm +++ /dev/null @@ -1,106 +0,0 @@ - - - - -
- |
-
- Boost.Preprocessor-Header <boost/preprocessor/list/fold_right.hpp>- |
-
Iterates OP(D,X,STATE)
for each element X
of the
-list LIST
(from the right or the end of the list).
In other words, expands to:
- --OP -( D -, BOOST_PP_LIST_AT(LIST,0) -, ... OP - ( D - , BOOST_PP_LIST_AT(LIST,BOOST_PP_SUB(BOOST_PP_LIST_SIZE(LIST),2)) - , OP - ( D - , BOOST_PP_LIST_AT(LIST,BOOST_PP_SUB(BOOST_PP_LIST_SIZE(LIST),1)) - , STATE - ) - ) ... -) -- -
For example,
- --#define TEST(D,X,STATE) BOOST_PP_CAT(STATE,X) -BOOST_PP_LIST_FOLD_RIGHT(TEST,_,BOOST_PP_TUPLE_TO_LIST(3,(A,B,C))) -- -
expands to:
- --_CBA -- -
Can be used inside BOOST_PP_WHILE() (see for an explanation of the D parameter).
- -Obsolete, just use BOOST_PP_LIST_FOLD_RIGHT().
-Obsolete, just use BOOST_PP_LIST_FOLD_RIGHT_D().
-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/list_fold_right_2nd.htm b/doc/reference/list_fold_right_2nd.htm deleted file mode 100644 index 15f139f..0000000 --- a/doc/reference/list_fold_right_2nd.htm +++ /dev/null @@ -1,46 +0,0 @@ - - - - -
- |
-
- Boost.Preprocessor-Header <boost/preprocessor/list/fold_right_2nd.hpp>- |
-
This header is obsolete. Use the following code instead.
- --#include <boost/preprocessor/list/fold_right.hpp> -- -
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/list_for_each.htm b/doc/reference/list_for_each.htm deleted file mode 100644 index d5656f8..0000000 --- a/doc/reference/list_for_each.htm +++ /dev/null @@ -1,81 +0,0 @@ - - - - -
- |
-
- Boost.Preprocessor-Header <boost/preprocessor/list/for_each.hpp>- |
-
Repeats MACRO(R,DATA,BOOST_PP_LIST_AT(LIST,INDEX))
for each INDEX = [0,
-BOOST_PP_LIST_SIZE(LIST)).
In other words, expands to the sequence:
- --MACRO(R,DATA,BOOST_PP_LIST_AT(LIST,0)) -MACRO(R,DATA,BOOST_PP_LIST_AT(LIST,1)) -... -MACRO(R,DATA,BOOST_PP_LIST_AT(LIST,BOOST_PP_DEC(BOOST_PP_LIST_SIZE(LIST)))) -- -
For example,
- --#define TEST(R,DATA,X) BOOST_PP_CAT(DATA,X)(); -BOOST_PP_LIST_FOR_EACH(TEST,prefix_,BOOST_PP_TUPLE_TO_LIST(3,(A,B,C))) -- -
expands to:
- --prefix_A(); prefix_B(); prefix_C(); -- -
Can be used inside BOOST_PP_FOR() (see for an explanation of the R parameter).
-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/list_for_each_i.htm b/doc/reference/list_for_each_i.htm deleted file mode 100644 index b4b0ac0..0000000 --- a/doc/reference/list_for_each_i.htm +++ /dev/null @@ -1,71 +0,0 @@ - - - - -
- |
-
- Boost.Preprocessor-Header <boost/preprocessor/list/for_each_i.hpp>- |
-
Repeats MACRO(R,DATA,INDEX,BOOST_PP_LIST_AT(LIST,INDEX))
for each INDEX = [0,
-BOOST_PP_LIST_SIZE(LIST)).
In other words, expands to the sequence:
- --MACRO(R,DATA,0,BOOST_PP_LIST_AT(LIST,0)) -MACRO(R,DATA,1,BOOST_PP_LIST_AT(LIST,1)) -... -MACRO(R,DATA,BOOST_PP_DEC(BOOST_PP_LIST_SIZE(LIST)),BOOST_PP_LIST_AT(LIST,BOOST_PP_DEC(BOOST_PP_LIST_SIZE(LIST)))) -- -
For example,
- --#define TEST(R,DATA,INDEX,X) BOOST_PP_CAT(DATA,X)(INDEX); -BOOST_PP_LIST_FOR_EACH_I(TEST,prefix_,BOOST_PP_TUPLE_TO_LIST(3,(A,B,C))) -- -
expands to:
- --prefix_A(0); prefix_B(1); prefix_C(2); -- -
Can be used inside BOOST_PP_FOR() (see for an explanation of the R parameter).
-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/list_for_each_product.htm b/doc/reference/list_for_each_product.htm deleted file mode 100644 index e70e6e1..0000000 --- a/doc/reference/list_for_each_product.htm +++ /dev/null @@ -1,82 +0,0 @@ - - - - -
- |
-
- Boost.Preprocessor-Header <boost/preprocessor/list/for_each_product.hpp>- |
-
Repeats MACRO(R,X)
for each element X
of the
-cartesian product of the lists of the SIZE_OF_TUPLE
-tuple TUPLE_OF_LISTS
.
This macro is useful for generating code to avoid combinatorial -explosion.
- -For example,
- --#define TEST(R,X) X -BOOST_PP_LIST_FOR_EACH_PRODUCT -( TEST -, 2 -, ( BOOST_PP_TUPLE_TO_LIST(3,(A,B,C)) - , BOOST_PP_TUPLE_TO_LIST(2,(1,2)) - ) -) -- -
expands to:
- --(A,1) (A,2) (B,1) (B,2) (C,1) (C,2) -- -
Can be used inside BOOST_PP_FOR() (see for an explanation of the R parameter).
-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/list_rest_n.htm b/doc/reference/list_rest_n.htm deleted file mode 100644 index e15dd24..0000000 --- a/doc/reference/list_rest_n.htm +++ /dev/null @@ -1,71 +0,0 @@ - - - - -
- |
-
- Boost.Preprocessor-Header <boost/preprocessor/list/rest_n.hpp>- |
-
Expands to a list of all but the first COUNT
elements of the
-list LIST
.
For example,
- --BOOST_PP_LIST_REST_N(2,BOOST_PP_TUPLE_TO_LIST(4,(+,-,*,/))) -- -
expands to the same as:
- --BOOST_PP_TUPLE_TO_LIST(2,(*,/)) -- -
Can be used inside BOOST_PP_WHILE() (see for an explanation of the D parameter).
-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/list_reverse.htm b/doc/reference/list_reverse.htm deleted file mode 100644 index 1e395fc..0000000 --- a/doc/reference/list_reverse.htm +++ /dev/null @@ -1,65 +0,0 @@ - - - - -
- |
-
- Boost.Preprocessor-Header <boost/preprocessor/list/reverse.hpp>- |
-
List reversal.
- -For example,
- --BOOST_PP_LIST_REVERSE(BOOST_PP_TUPLE_TO_LIST(3,(A,B,C))) -- -
expands to the same as:
- --BOOST_PP_TUPLE_TO_LIST(3,(C,B,A)) -- -
Can be used inside BOOST_PP_WHILE() (see for an explanation of the D parameter).
-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/list_size.htm b/doc/reference/list_size.htm deleted file mode 100644 index 5135860..0000000 --- a/doc/reference/list_size.htm +++ /dev/null @@ -1,61 +0,0 @@ - - - - -
- |
-
- Boost.Preprocessor-Header <boost/preprocessor/list/size.hpp>- |
-
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
.
Can be used inside BOOST_PP_WHILE() (see for an explanation of the D parameter).
-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/list_to_tuple.htm b/doc/reference/list_to_tuple.htm deleted file mode 100644 index 5794af0..0000000 --- a/doc/reference/list_to_tuple.htm +++ /dev/null @@ -1,67 +0,0 @@ - - - - -
- |
-
- Boost.Preprocessor-Header <boost/preprocessor/list/to_tuple.hpp>- |
-
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)
.
Can be used inside BOOST_PP_FOR() (see for an explanation of the R parameter).
-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/list_transform.htm b/doc/reference/list_transform.htm deleted file mode 100644 index bc40484..0000000 --- a/doc/reference/list_transform.htm +++ /dev/null @@ -1,76 +0,0 @@ - - - - -
- |
-
- Boost.Preprocessor-Header <boost/preprocessor/list/transform.hpp>- |
-
Applies the macro OP(D,DATA,X)
to each element X
-of the list producing a new list.
In other words, expands to:
- --BOOST_PP_LIST_CONS(OP(D,DATA,BOOST_PP_LIST_AT(LIST,0)), -BOOST_PP_LIST_CONS(OP(D,DATA,BOOST_PP_LIST_AT(LIST,1)), -... -BOOST_PP_LIST_CONS(OP(D,DATA,BOOST_PP_LIST_AT(LIST,BOOST_PP_DEC(BOOST_PP_LIST_SIZE(LIST)))), -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 the same as:
- --BOOST_PP_TUPLE_TO_LIST(2,(3,4)) -- -
Can be used inside BOOST_PP_WHILE() (see for an explanation of the D parameter).
-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/logical.htm b/doc/reference/logical.htm deleted file mode 100644 index 2f5f6c1..0000000 --- a/doc/reference/logical.htm +++ /dev/null @@ -1,41 +0,0 @@ - - - - -
- |
-
- Boost.Preprocessor-Header <boost/preprocessor/logical.hpp>- |
-
Includes all logical headers.
-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/logical_and.htm b/doc/reference/logical_and.htm deleted file mode 100644 index 36e6bad..0000000 --- a/doc/reference/logical_and.htm +++ /dev/null @@ -1,54 +0,0 @@ - - - - -
- |
-
- Boost.Preprocessor-Header <boost/preprocessor/logical/and.hpp>- |
-
Expands to the logical AND of the operands.
- -Both X
and Y
must expand to integer literals
-in the range [0, BOOST_PP_LIMIT_MAG].
For example, BOOST_PP_AND(0,5)
expands to 0
(a single token).
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/logical_bool.htm b/doc/reference/logical_bool.htm deleted file mode 100644 index ec5e230..0000000 --- a/doc/reference/logical_bool.htm +++ /dev/null @@ -1,48 +0,0 @@ - - - - -
- |
-
- Boost.Preprocessor-Header <boost/preprocessor/logical/bool.hpp>- |
-
Expands to 0
if X == 0
and 1
if X != 0
.
X
must be an integer literal in the range [0, BOOST_PP_LIMIT_MAG].
For example, BOOST_PP_BOOL(3)
expands to 1
.
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/logical_nor.htm b/doc/reference/logical_nor.htm deleted file mode 100644 index 1a6c790..0000000 --- a/doc/reference/logical_nor.htm +++ /dev/null @@ -1,54 +0,0 @@ - - - - -
- |
-
- Boost.Preprocessor-Header <boost/preprocessor/logical/nor.hpp>- |
-
Expands to the logical NEITHER OR of the operands.
- -Both X
and Y
must expand to integer literals
-in the range [0, BOOST_PP_LIMIT_MAG].
For example, BOOST_PP_NOR(0,5)
expands to 0
(a single token).
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/logical_not.htm b/doc/reference/logical_not.htm deleted file mode 100644 index 99c0293..0000000 --- a/doc/reference/logical_not.htm +++ /dev/null @@ -1,53 +0,0 @@ - - - - -
- |
-
- Boost.Preprocessor-Header <boost/preprocessor/logical/not.hpp>- |
-
Expands to the logical NOT of the operand.
- -X
must be an integer literal in the range [0, BOOST_PP_LIMIT_MAG].
For example, BOOST_PP_NOT(0)
expands to 1
(a single token).
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/logical_or.htm b/doc/reference/logical_or.htm deleted file mode 100644 index f54fcd0..0000000 --- a/doc/reference/logical_or.htm +++ /dev/null @@ -1,54 +0,0 @@ - - - - -
- |
-
- Boost.Preprocessor-Header <boost/preprocessor/logical/or.hpp>- |
-
Expands to the logical OR of the operands.
- -Both X
and Y
must expand to integer literals
-in the range [0, BOOST_PP_LIMIT_MAG].
For example, BOOST_PP_OR(0,2)
expands to 1
(a single token).
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/logical_xor.htm b/doc/reference/logical_xor.htm deleted file mode 100644 index 6dc59bb..0000000 --- a/doc/reference/logical_xor.htm +++ /dev/null @@ -1,54 +0,0 @@ - - - - -
- |
-
- Boost.Preprocessor-Header <boost/preprocessor/logical/xor.hpp>- |
-
Expands to the logical EXCLUSIVE OR of the operands.
- -Both X
and Y
must expand to integer literals
-in the range [0, BOOST_PP_LIMIT_MAG].
For example, BOOST_PP_XOR(1,2)
expands to 0
(a single token).
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/max.htm b/doc/reference/max.htm deleted file mode 100644 index ee15baa..0000000 --- a/doc/reference/max.htm +++ /dev/null @@ -1,59 +0,0 @@ - - - - -
- |
-
- Boost.Preprocessor-Header <boost/preprocessor/max.hpp>- |
-
Expands to the maximum of X
and Y
.
Both X
and Y
must expand to integer literals
-in the range [0, BOOST_PP_LIMIT_MAG].
For example, BOOST_PP_MAX(5,7)
expands to 7
(a
-single token).
Can be used inside BOOST_PP_WHILE() (see for an explanation of the D parameter).
-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/min.htm b/doc/reference/min.htm deleted file mode 100644 index 12cdd5c..0000000 --- a/doc/reference/min.htm +++ /dev/null @@ -1,59 +0,0 @@ - - - - -
- |
-
- Boost.Preprocessor-Header <boost/preprocessor/min.hpp>- |
-
Expands to the minimum of X
and Y
.
Both X
and Y
must expand to integer literals
-in the range [0, BOOST_PP_LIMIT_MAG].
For example, BOOST_PP_MIN(5,7)
expands to 5
(a
-single token).
Can be used inside BOOST_PP_WHILE() (see for an explanation of the D parameter).
-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.htm b/doc/reference/repeat.htm deleted file mode 100644 index e0d959c..0000000 --- a/doc/reference/repeat.htm +++ /dev/null @@ -1,95 +0,0 @@ - - - - -
- |
-
- Boost.Preprocessor-Header <boost/preprocessor/repeat.hpp>- |
-
Repeats the macro MACRO(INDEX,DATA)
for INDEX = [0,COUNT)
.
In other words, expands to the sequence:
- --MACRO(0,DATA) MACRO(1,DATA) ... MACRO(BOOST_PP_DEC(COUNT),DATA) -- -
For example,
- --#define TEST(INDEX,DATA) DATA(INDEX); -BOOST_PP_REPEAT(3,TEST,X) -- -
expands to:
- --X(0); X(1); X(2); -- -
BOOST_PP_REPEAT() implements automatic recursion. 2D and 3D repetition -are directly supported.
- -Obsolete, just use BOOST_PP_REPEAT().
-Obsolete, just use BOOST_PP_REPEAT().
-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_2nd.htm b/doc/reference/repeat_2nd.htm deleted file mode 100644 index 4ddaf5b..0000000 --- a/doc/reference/repeat_2nd.htm +++ /dev/null @@ -1,46 +0,0 @@ - - - - -
- |
-
- Boost.Preprocessor-Header <boost/preprocessor/repeat_2nd.hpp>- |
-
This header is obsolete. Use the following code instead.
- --#include <boost/preprocessor/repeat.hpp> -- -
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_3rd.htm b/doc/reference/repeat_3rd.htm deleted file mode 100644 index 62754fd..0000000 --- a/doc/reference/repeat_3rd.htm +++ /dev/null @@ -1,46 +0,0 @@ - - - - -
- |
-
- Boost.Preprocessor-Header <boost/preprocessor/repeat_3rd.hpp>- |
-
This header is obsolete. Use the following code instead.
- --#include <boost/preprocessor/repeat.hpp> -- -
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.htm b/doc/reference/repeat_from_to.htm deleted file mode 100644 index 85074a7..0000000 --- a/doc/reference/repeat_from_to.htm +++ /dev/null @@ -1,89 +0,0 @@ - - - - -
- |
-
- Boost.Preprocessor-Header <boost/preprocessor/repeat_from_to.hpp>- |
-
Repeats the macro MACRO(INDEX,DATA)
for INDEX = [FIRST,LAST)
.
In other words, expands to the sequence:
- --MACRO(FIRST,DATA) MACRO(BOOST_PP_INC(FIRST),DATA) ... MACRO(BOOST_PP_DEC(LAST),DATA) -- -
For example,
- --#define TEST(INDEX,DATA) DATA(INDEX); -BOOST_PP_REPEAT_FROM_TO(4,7,TEST,X) -- -
expands to:
- --X(4); X(5); X(6); -- -
BOOST_PP_REPEAT_FROM_TO() implements automatic recursion. 2D and 3D repetition -are directly supported.
- -Obsolete, just use BOOST_PP_REPEAT_FROM_TO().
-Obsolete, just use BOOST_PP_REPEAT_FROM_TO().
-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 deleted file mode 100644 index 58029c9..0000000 --- a/doc/reference/repeat_from_to_2nd.htm +++ /dev/null @@ -1,46 +0,0 @@ - - - - -
- |
-
- Boost.Preprocessor-Header <boost/preprocessor/repeat_from_to_2nd.hpp>- |
-
This header is obsolete. Use the following code instead.
- --#include <boost/preprocessor/repeat_from_to.hpp> -- -
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 deleted file mode 100644 index 741dbcc..0000000 --- a/doc/reference/repeat_from_to_3rd.htm +++ /dev/null @@ -1,46 +0,0 @@ - - - - -
- |
-
- Boost.Preprocessor-Header <boost/preprocessor/repeat_from_to_3rd.hpp>- |
-
This header is obsolete. Use the following code instead.
- --#include <boost/preprocessor/repeat_from_to.hpp> -- -
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 deleted file mode 100644 index 17430ad..0000000 --- a/doc/reference/stringize.htm +++ /dev/null @@ -1,56 +0,0 @@ - - - - -
- |
-
- Boost.Preprocessor-Header <boost/preprocessor/stringize.hpp>- |
-
Stringizes X
after it is macro expanded.
For example, BOOST_PP_STRINGIZE(BOOST_PP_CAT(a,b))
expands to "ab"
.
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/tuple.htm b/doc/reference/tuple.htm deleted file mode 100644 index d5faebb..0000000 --- a/doc/reference/tuple.htm +++ /dev/null @@ -1,58 +0,0 @@ - - - - -
- |
-
- Boost.Preprocessor-Header <boost/preprocessor/tuple.hpp>- |
-
Includes all tuple headers.
- -A tuple is a fixed size collection of elements.
- -In the preprocessor library, tuples are represented like macro parameter -lists. Thus an element of a tuple can be any sequence of tokens that -constitutes a single macro parameter.
- -Examples of tuples:
- --(const, volatile) // 2-tuple -(*, /, %) // 3-tuple -(1, "2", '3', (4,5)) // 4-tuple -- -
Tuples can be used for representing structured data.
- -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/tuple_eat.htm b/doc/reference/tuple_eat.htm deleted file mode 100644 index 4861c02..0000000 --- a/doc/reference/tuple_eat.htm +++ /dev/null @@ -1,55 +0,0 @@ - - - - -
- |
-
- Boost.Preprocessor-Header <boost/preprocessor/tuple/eat.hpp>- |
-
Expands to a macro that eats a tuple of the specified size.
- -BOOST_PP_TUPLE_EAT() is designed to be used with BOOST_PP_IF() like -BOOST_PP_EMPTY().
- -For example,
- --BOOST_PP_IF(0,BOOST_PP_ENUM_PARAMS,BOOST_PP_TUPLE_EAT(2))(10,P) -- -
expands to nothing.
- -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/tuple_elem.htm b/doc/reference/tuple_elem.htm deleted file mode 100644 index e3996f9..0000000 --- a/doc/reference/tuple_elem.htm +++ /dev/null @@ -1,57 +0,0 @@ - - - - -
- |
-
- Boost.Preprocessor-Header <boost/preprocessor/tuple/elem.hpp>- |
-
Expands to the INDEX
:th element of an SIZE_OF_TUPLE
-tuple.
For example,
- --BOOST_PP_TUPLE_ELEM(2,1,(A,B)) -- -
expands to B
.
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/tuple_reverse.htm b/doc/reference/tuple_reverse.htm deleted file mode 100644 index 466057b..0000000 --- a/doc/reference/tuple_reverse.htm +++ /dev/null @@ -1,52 +0,0 @@ - - - - -
- |
-
- Boost.Preprocessor-Header <boost/preprocessor/tuple/reverse.hpp>- |
-
Tuple reversal.
- -For example,
- --BOOST_PP_TUPLE_REVERSE(3,(A,B,C)) -- -
expands to (C,B,A)
.
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/tuple_to_list.htm b/doc/reference/tuple_to_list.htm deleted file mode 100644 index e36a38f..0000000 --- a/doc/reference/tuple_to_list.htm +++ /dev/null @@ -1,64 +0,0 @@ - - - - -
- |
-
- Boost.Preprocessor-Header <boost/preprocessor/tuple/to_list.hpp>- |
-
Converts a tuple to a list.
- -For example,
- --BOOST_PP_TUPLE_TO_LIST(3,(A,B,C)) -- -
expands to the same as
- --BOOST_PP_LIST_CONS(A, -BOOST_PP_LIST_CONS(B, -BOOST_PP_LIST_CONS(C, -BOOST_PP_LIST_NIL))) -- -
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/while.htm b/doc/reference/while.htm deleted file mode 100644 index 8527beb..0000000 --- a/doc/reference/while.htm +++ /dev/null @@ -1,107 +0,0 @@ - - - - -
- |
-
- Boost.Preprocessor-Header <boost/preprocessor/while.hpp>- |
-
Iterates OP(D,STATE)
while PRED(D,STATE)
is true.
In other words, expands to:
- --OP(D, ... OP(D, OP(D,STATE) ) ... ) -- -
The depth of iteration is determined by PRED(D,STATE)
.
For example,
- --#define PRED(D,STATE) BOOST_PP_LESS_D(D,BOOST_PP_TUPLE_ELEM(2,0,STATE),BOOST_PP_TUPLE_ELEM(2,1,STATE)) -#define OP(D,STATE) (BOOST_PP_INC(BOOST_PP_TUPLE_ELEM(2,0,STATE)),BOOST_PP_TUPLE_ELEM(2,1,STATE)) -BOOST_PP_WHILE(PRED,OP,(0,3)) -- -
expands to:
- --(3,3) -- -
BOOST_PP_WHILE() currently does not implement automatic recursion. The reason -for this is that it would lead to very poor performance. The automatic recursion -technique takes O(N) steps just to find out that the Nth recursion should be used. -This would dramatically effect the time complexity of macros using automatic -recursion.
- -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/tutorial.htm b/doc/tutorial.htm deleted file mode 100644 index c803cbd..0000000 --- a/doc/tutorial.htm +++ /dev/null @@ -1,478 +0,0 @@ - - - - -
- |
-
- Boost.Preprocessor-Tutorial- |
-
The C++ function and template parameter lists are special syntactic constructs - and it is impossible to directly manipulate or generate them using C++ constructs. - This leads to unnecessary code repetition.
-Consider the implementation of the is_function<> metafunction in Boost. The - implementation uses an overloaded is_function_tester() function that is used - for testing if a type is convertible to pointer to a function. Because of the - special treatment of parameter lists, it is not possible to directly match a - function with an arbitrary parameter list. Instead, the is_function_tester() - must be overloaded for every distinct number of parameters that is to be supported. - Example:
- -template <class R> -yes_type is_function_tester(R (*)()); -template <class R, class A0> -yes_type is_function_tester(R (*)(A0)); -template <class R, class A0, A1> -yes_type is_function_tester(R (*)(A0, A1)); -template <class R, class A0, A1, A2> -yes_type is_function_tester(R (*)(A0, A1, A2)); - -// ... -- -
The need for this kind of repetition occurs particularly frequently while implementing - generic components or metaprogramming facilities, but the need also manifests - itself in many far simpler situations.
- -Typically the repetition is done manually. Manual code repetition is highly - unproductive, but sometimes more readable to the untrained eye.
-Another solution is to write an external program for generating the repeated - code or use some other extra linquistic means such as a smart editor. Unfortunately, - using external code generators has many disadvantages:
-Because C++ comes with a preprocessor, one would assume that it would support - these kind of needs directly. Using the preprocessor in this case is highly - desirable because:
-Most unfortunately, the preprocessor is a very low level preprocessor that - specifically does not support repetition or recursive macros. Library support - is needed!
-For detailed information on the capabilities and limitations of the preprocessor, - please refer to the C++ standard [Std].
-Using the primitives of the PREPROCESSOR library, the is_function_tester()s - could be implemented like this:
- -#define IS_FUNCTION_TESTER(N,_)\ - template<class R BOOST_PP_COMMA_IF(N) BOOST_PP_ENUM_PARAMS(N, class A)>\ - yes_type is_function_tester(R (*)(BOOST_PP_ENUM_PARAMS(N,A))); - -BOOST_PP_REPEAT(BOOST_PP_INC(MAX_IS_FUNCTION_TESTER_PARAMS),IS_FUNCTION_TESTER,_) -#undef IS_FUNCTION_TESTER -- -
In order to change the maximum number of function parameters supported, you - now simply change the MAX_IS_FUNCTION_TESTER_PARAMS definition and recompile.
-The preprocessor metaprogramming techniques are presented in example format. -
-EXAMPLE: - Use a Local Macro to avoid small scale repetition
- -#define BOOST_PP_DEF(OP) \ - template<class T, int n> \ - vec<T,n>& \ - operator OP##= \ - ( vec<T,n>& \ - lhs \ - , const vec<T,n>& \ - rhs \ - ) \ - { for (int i=0; i<n; ++i)\ - lhs(i) OP##= rhs(i); \ - return lhs; \ - } - -BOOST_PP_DEF(+) -BOOST_PP_DEF(-) -BOOST_PP_DEF(*) -BOOST_PP_DEF(/) -#undef BOOST_PP_DEF -- -
TIP: It is usually okay to use a standard macro name like BOOST_PP_DEF - for this kind of code, because the macro is both defined and undefined in the - immediate site of its use.
-TIP: It is easier to verify proper use of -the line continuation operator when they are aligned.
-NOTES: You can extend this example by defining more and different kinds - of operators. Before doing so, consider using the Algebraic Categories technique - introduced in [Barton] or a Layered Architecture (see for instance - [Czarnecki]). However, at some point you must type the operator tokens - *, /, +, -, ..., because it is impossible to generate them using templates. - The resulting Categorical Repetition of tokens can be eliminated by using preprocessor - metaprogramming.
-EXAMPLE: - Use BOOST_PP_EMPTY as an unused parameter in Local Macro instantiations
- -#define BOOST_PP_DEF(CV) \ - template<class base> \ - CV() typename implement_subscript_using_begin_subscript<base>::value_type&\ - implement_subscript_using_begin_subscript<base>::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 -- -
HOW: BOOST_PP_EMPTY() expands to nothing and can be used as - an unused parameter.
-NOTE: BOOST_PP_EMPTY without the () never gets expanded. The - () is necessary to invoke a function-like macro.
-CAVEAT: You can not safely use concatenation while using BOOST_PP_EMPTY(). -TIP: Occasionally one or two lines are -considerably longer than the rest. It can often save some work to not align all -of the line continuation operators without making the code too unreadable.
-TIP: Use syntax highlighting on preprocessor metaprogramming macro and - parameter identifiers such as
-It can greatly improve readability.
-EXAMPLE: Use BOOST_PP_CAT instead of ## when necessary
- -#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)); -- -
WHY: Macro expansion proceeds recursively in "layers". Token pasting - prevents the preprocessor from performing macro expansion, therefore it - is often necessary to delay token concatenation.
-EXAMPLE: Use BOOST_PP_STRINGIZE instead of # whenever necessary
- -#define NOTE(STR)\ - message(__FILE__ "(" BOOST_PP_STRINGIZE(__LINE__) ") : " STR) - -// ... - -#pragma NOTE("TBD!") -- -
WHY: Macro expansion proceeds recursively in "layers". Stringization - prevents the preprocessor from performing macro expansion, therefore it is often - necessary to delay stringization.
-EXAMPLE: - Use:
-to avoid O(N) repetition on lists in general
- -struct make_type_list_end; - -template -< BOOST_PP_ENUM_PARAMS_WITH_A_DEFAULT - ( MAKE_TYPE_LIST_MAX_LENGTH - , class T - , make_type_list_end - ) -> -struct make_type_list -{ -private: - enum - { end = is_same<T0,make_type_list_end>::value - }; - -public: - typedef typename - type_if - < end - , type_cons_empty - , type_cons - < T0 - , typename - type_inner_if - < end - , type_identity<end> - , make_type_list - < BOOST_PP_ENUM_SHIFTED_PARAMS - ( MAKE_TYPE_LIST_MAX_LENGTH - , T - ) - > - >::type - > - >::type type; -}; -- -
HOW: BOOST_PP_REPEAT uses simulated recursion (pseudo code):
- -#define BOOST_PP_REPEAT(N,M,P) BOOST_PP_REPEAT##N(M,P) -#define BOOST_PP_REPEAT0(M,P) -#define BOOST_PP_REPEAT1(M,P) M(0,P) -#define BOOST_PP_REPEAT2(M,P) M(0,P) M(1,P) -#define BOOST_PP_REPEAT3(M,P) BOOST_PP_REPEAT2(M,P) M(2,P) -#define BOOST_PP_REPEAT4(M,P) BOOST_PP_REPEAT3(M,P) M(3,P) -// ... -- -
BOOST_PP_ENUM_PARAMS variations use BOOST_PP_REPEAT
- -BOOST_PP_COMMA_IF(I) expands to a comma if I != 0.
- -BOOST_PP_INC(I) expands essentially to "I+1" and BOOST_PP_DEC(I) - expands essentially to "I-1".
- -EXAMPLE: Use a Conditional Define to -enable user configuration of code repetition based on need rather than some -"reasonable" upper limit
- -#ifndef MAKE_TYPE_LIST_MAX_LENGTH -#define MAKE_TYPE_LIST_MAX_LENGTH 8 -#endif -- -
Now the user can configure the make_type_list primitive without modifying library - code.
-EXAMPLE: - Use BOOST_PP_REPEAT and a Token Look-Up Function to eliminate categorical - repetition
- -// CAVEAT: My compiler is not standard on arithmetic types. -#define ARITHMETIC_TYPE(I) ARITHMETIC_TYPE##I -#define ARITHMETIC_TYPE0 bool -#define ARITHMETIC_TYPE1 char -#define ARITHMETIC_TYPE2 signed char -#define ARITHMETIC_TYPE3 unsigned char -#define ARITHMETIC_TYPE4 short -#define ARITHMETIC_TYPE5 unsigned short -#define ARITHMETIC_TYPE6 int -#define ARITHMETIC_TYPE7 unsigned int -#define ARITHMETIC_TYPE8 long -#define ARITHMETIC_TYPE9 unsigned long -#define ARITHMETIC_TYPE10 float -#define ARITHMETIC_TYPE11 double -#define ARITHMETIC_TYPE12 long double -#define ARITHMETIC_TYPE_CNT 13 - -// ... - -#define BOOST_PP_DEF(I,_)\ -catch (ARITHMETIC_TYPE(I) t)\ -{ report_typeid(t);\ - report_value(t);\ -} -BOOST_PP_REPEAT -( ARITHMETIC_TYPE_CNT -, BOOST_PP_DEF -, _ -) -#undef BOOST_PP_DEF - -// ... -- -
NOTE: The repetition of the above -example can be eliminated using template metaprogramming [Czarnecki] as well. However -categorical repetition of operator tokens can not be completely eliminated by -using template metaprogramming.
-EXAMPLE: - Use BOOST_PP_REPEAT to avoid O(N*N) repetition
- -#ifndef MAX_VEC_ARG_CNT -#define MAX_VEC_ARG_CNT 8 -#endif - -// ... - -#define ARG_FUN(I,_) BOOST_PP_COMMA_IF(I) T a##I -#define ASSIGN_FUN(I,_) (*this)[I] = a##I; - -#define DEF_VEC_CTOR_FUN(I,_)\ -vec( BOOST_PP_REPEAT(I,ARG_FUN,_) )\ -{ BOOST_PP_REPEAT(I,ASSIGN_FUN,_)\ -} - -BOOST_PP_REPEAT -( BOOST_PP_INC(MAX_VEC_ARG_CNT) -, DEF_VEC_CTOR_FUN -, _ -) - -#undef ARG_FUN -#undef ASSIGN_FUN -#undef DEF_VEC_CTOR_FUN - -// ... -- -
HOW: BOOST_PP_REPEAT is implemented in a special way to enable -automatic recursion.
- -EXAMPLE: Use BOOST_PP_IF to implement special case for the first element
- -#define BOOST_PP_COMMA_IF(C)\ - BOOST_PP_IF(C,BOOST_PP_COMMA,BOOST_PP_EMPTY)() - -BOOST_PP_IF(0,true,false) == false; -BOOST_PP_IF(1,true,false) == true; -- -
BOOST_PP_IF enables convenient generation of lists using BOOST_PP_REPEAT.
- -NOTE: THEN and ELSE don't have to be macros. However, if at least one - of them is a function-like macro and you want it to be expanded conditionally, - you have to make the other parameter a function-like macro, too. This can often - be done using BOOST_PP_IDENTITY. Consider the following example (by - Aleksey Gurtovoy):
- -#define NUMBERED_EXPRESSION(I,X)\ - BOOST_PP_IF \ - ( I \ - , BOOST_PP_IDENTITY(X##I) \ - , BOOST_PP_EMPTY \ - )()- -
NOTE: Like in the above implementation of COMMA_IF, the result of IF - is often invoked and not the THEN and ELSE parameters. If the parameters were - invoked, the code would not expand correctly, because the EMPTY parameter would - get expanded to nothing before the IF would be properly expanded.
-HOW: BOOST_PP_IF is defined for the entire repeat range (pseudo - code):
- -#define BOOST_PP_IF(C,THEN,ELSE) BOOST_PP_IF##C(THEN,ELSE) -#define BOOST_PP_IF0(THEN,ELSE) ELSE -#define BOOST_PP_IF1(THEN,ELSE) THEN -#define BOOST_PP_IF2(THEN,ELSE) THEN -// ... -- -
EXAMPLE: Use arithmetic, logical and comparison operations when necessary
- -The PREPROCESSOR library supports saturated arithmetic, logical and -comparison operations on decimal integer literals in the range [0,BOOST_PP_LIMIT_MAG].
- -Suppose that you want to generate a numbered lists with a special element inserted - at a desired position. For example: E0, E1, S, E2. Consider the following example:
- -#define SPECIAL_NUMBERED_LIST(N,I,ELEM,SPECIAL)\ - BOOST_PP_ASSERT_MSG(BOOST_PP_LESS(I,N),BAD PARAMS FOR SPECIAL_NUMBERED_LIST!)\ - BOOST_PP_ENUM_PARAMS(I,ELEM)\ - BOOST_PP_COMMA_IF(I) SPECIAL\ - BOOST_PP_REPEAT(BOOST_PP_SUB(\ - BOOST_PP_DEC(N),I),SPECIAL_NUMBERED_LIST_HELPER,(ELEM,I)) -#define SPECIAL_NUMBERED_LIST_HELPER(I,ELEM_BASE)\ - ,\ - BOOST_PP_CAT\ - ( BOOST_PP_TUPLE_ELEM(2,0,ELEM_BASE)\ - , BOOST_PP_ADD\ - ( I\ - , BOOST_PP_TUPLE_ELEM(2,1,ELEM_BASE)\ - )\ - ) - -SPECIAL_NUMBERED_LIST(3,0,E,S) -SPECIAL_NUMBERED_LIST(3,1,E,S) -SPECIAL_NUMBERED_LIST(3,2,E,S) -SPECIAL_NUMBERED_LIST(3,3,E,S) -- -
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/example/array_arithmetic.c b/example/array_arithmetic.c deleted file mode 100644 index 9f5f3cb..0000000 --- a/example/array_arithmetic.c +++ /dev/null @@ -1,145 +0,0 @@ -/* 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. - */ - -/* This example implements over 2200 functions for 1-dimensional arithmetic - * array manipulation in C. The idea is to use preprocessor data structures, - * lists and tuples, for storing metainformation to be used for generating - * the actual C code. - * - * Who needs templates anyway? :) - * - * Compile with any C compiler with a standards conforming preprocessor. - */ - -#includeRepeats the macro M(X,Y,DATA)
for X = [0,W)
and Y = [0,H)
.
In other words, expands to the sequence:
- --M( 0, 0, DATA) M( 1, 0, DATA) ... M(W-1, 0, DATA) -M( 0, 1, DATA) M( 1, 1, DATA) ... M(W-1, 1, DATA) - ... ... ... ... -M( 0,H-1, DATA) M( 1,H-1, DATA) ... M(W-1,H-1, DATA) --*/ -#define REPEAT_2D(W,H,M,DATA)\ - /* Here we can simply use BOOST_PP_REPEAT(), because\ - * it implements automatic recursion.\ - */\ - BOOST_PP_REPEAT\ - ( H\ - , REPEAT_2D_ROW\ - , (W,M,DATA)\ - ) - -#define REPEAT_2D_ROW(Y,WMD)\ - BOOST_PP_REPEAT\ - ( BOOST_PP_TUPLE_ELEM(3,0,WMD)\ - , REPEAT_2D_ELEM\ - , (Y, BOOST_PP_TUPLE_ELEM(3,1,WMD), BOOST_PP_TUPLE_ELEM(3,2,WMD))\ - ) -#define REPEAT_2D_ELEM(X,YMD)\ - BOOST_PP_TUPLE_ELEM(3,1,YMD)\ - ( X\ - , BOOST_PP_TUPLE_ELEM(3,0,YMD)\ - , BOOST_PP_TUPLE_ELEM(3,2,YMD)\ - ) - -#include