diff --git a/doc/acknowledgements.htm b/doc/acknowledgements.htm new file mode 100644 index 0000000..1d0fcba --- /dev/null +++ b/doc/acknowledgements.htm @@ -0,0 +1,40 @@ + + + +Boost.Preprocessor - Acknowledgements + + + + + + + +
+

C++ Boost

+
+

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 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/examples_preprocessed.htm b/doc/examples_preprocessed.htm index 2518cd7..428efc8 100644 --- a/doc/examples_preprocessed.htm +++ b/doc/examples_preprocessed.htm @@ -1,16 +1,22 @@ -Boost PREPROCESSOR library +Boost.Preprocessor - Tutorial examples preprocessed - - -c++boost.gif (8819 bytes) + + + + + + +
+

C++ Boost

+
+

Boost.Preprocessor

+

Tutorial examples preprocessed

+

-

Boost PREPROCESSOR library: 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.

@@ -323,12 +329,15 @@ BAD PARAMS FOR SPECIAL_NUMBERED_LIST! E0, E1, E2, S
-

© Copyright Housemarque Oy 2001

-

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

-

Updated: -

+

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 index 455ae0d..2742b19 100644 --- a/doc/index.htm +++ b/doc/index.htm @@ -1,64 +1,41 @@ - -Boost PREPROCESSOR library - - - - - - - - - - - + + + +Boost.Preprocessor - Index + + +
c++boost.gif (8819 bytes)Home Libraries People FAQ More
+ + +
+

C++ Boost

+
+

Boost.Preprocessor

+

Index

+
-

Boost PREPROCESSOR library

+
-

C++ programming sometimes involves repeating lists of template or function - parameters. Such repetition is troublesome, because it tends to be done manually, - which means that the maximum number of parameters is bound into the design of - the program making it difficult to configure. Automating the repetition using - extra linguistic tools introduces another set of problems.

-

The C preprocessor is part of the C++ language and can manipulate and generate - tokens. Unfortunately the C preprocessor is also a very low level macro processor. - In particular, it doesn't directly support repetition or recursion. Fortunately - it is possible to perform finite repetition and recursion using a library of - preprocessor primitives.

-

The PREPROCESSOR library provides facilities for C preprocessor metaprogramming. - Preprocessor metaprogramming makes it possible to generate function and template - parameter lists and make libraries configurable through preprocessor definitions.

-

Documentation

- -
-
  • Tutorial -
  • Reference -
  • Widely known problems with the C preprocessor -
  • Keywords for syntax highlighting -
  • References -
  • Known problems with specific compilers -
  • - -

    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 PREPROCESSOR library has been developed by -Vesa Karvonen.

    +

    Contents

    +
    +
    Tutorial
    +
    Reference
    +
    Widely known problems with the C preprocessor
    +
    Keywords for syntax highlighting
    +
    Known problems with specific compilers
    +
    References
    +
    Acknowledgements
    +

    -

    © Copyright Housemarque Oy 2001

    -

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

    -

    Updated: 30 Nov 2001 -

    - - \ No newline at end of file +

    © 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/known_problems_with_cpp.htm b/doc/known_problems_with_cpp.htm index c892274..7d3cedc 100644 --- a/doc/known_problems_with_cpp.htm +++ b/doc/known_problems_with_cpp.htm @@ -1,17 +1,25 @@ - -Boost PREPROCESSOR library - -c++boost.gif (8819 bytes) + + + +Boost.Preprocessor - Widely known problems with the C preprocessor + + + + + + + +
    +

    C++ Boost

    +
    +

    Boost.Preprocessor

    +

    Widely known problems with the C preprocessor

    +
    +
    -

    Boost PREPROCESSOR library: Widely known problems with the C preprocessor

    - -

    - -Preprocessor metaprogramming is subject to heated discussions. Part of this is caused by +

    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 @@ -102,12 +110,15 @@ long time.

    In practice, preprocessor metaprogramming is far simpler and more portable than template metaprogramming [2].


    -

    © Copyright Housemarque Oy 2001

    -

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

    -

    Updated:

    -

    - - +

    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 index 36b9c29..03dad6e 100644 --- a/doc/problems_with_compilers.htm +++ b/doc/problems_with_compilers.htm @@ -1,13 +1,23 @@ - -Boost PREPROCESSOR library - -c++boost.gif (8819 bytes) -
    + + + +Boost.Preprocessor - Known problems with specific compilers + + + + + + + +
    +

    C++ Boost

    +
    +

    Boost.Preprocessor

    +

    Known problems with specific compilers

    +
    -

    Boost PREPROCESSOR library: Known problems with specific compilers

    +

    Some compilers have buggy or limited preprocessors. This page explains known problems with specific compilers.

    @@ -115,12 +125,15 @@ BOOST_PP_REPEAT_2ND(BOOST_PP_INC(IS_FUNCTION_HELPER_TEST_MAX),IS_FUNCTION_HELPER

    Reported by Aleksey Gurtovoy


    -

    © Copyright Housemarque Oy 2001

    -

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

    -

    Updated:

    -

    - - +

    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 index cd9a479..b317d8d 100644 --- a/doc/reference/list_to_tuple.htm +++ b/doc/reference/list_to_tuple.htm @@ -45,7 +45,7 @@

    Uses


    diff --git a/doc/references.htm b/doc/references.htm index ccfdf25..98f42dc 100644 --- a/doc/references.htm +++ b/doc/references.htm @@ -1,13 +1,23 @@ - -Boost PREPROCESSOR library - -c++boost.gif (8819 bytes) -
    + + + +Boost.Preprocessor - References + + + + + + + +
    +

    C++ Boost

    +
    +

    Boost.Preprocessor

    +

    References

    +
    -

    Boost PREPROCESSOR library: References

    +
    1. Stroustrup: The Design and Evolution of C++, ISBN 0-201-54330-3 @@ -20,16 +30,11 @@
      -

      +

      © Copyright Housemarque Oy 2002

      -

      © Copyright Housemarque Oy 2001

      -

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

      -

      Updated: -

      - -

      - - +

      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 index 6c852bb..399ad37 100644 --- a/doc/tutorial.htm +++ b/doc/tutorial.htm @@ -1,36 +1,47 @@ - -Boost PREPROCESSOR library - -c++boost.gif (8819 bytes) + + + +Boost.Preprocessor - Tutorial + + + + + + + +
      +

      C++ Boost

      +
      +

      Boost.Preprocessor

      +

      Tutorial

      +

      -

      Boost PREPROCESSOR library: Tutorial

      -

      Contents

      - +
      +
      Motivation
      +
      Preprocessor Metaprogramming Techniques +
      +
      Use a Local Macro to avoid small scale repetition
      +
      Use BOOST_PP_EMPTY as an unused parameter in Local + Macro instantiations
      +
      Use BOOST_PP_CAT instead of ## when necessary
      +
      Use BOOST_PP_STRINGIZE instead of # whenever necessary
      +
      Avoid O(N) repetition on lists in general
      +
      Use a Conditional Define to enable user configuration of code repetition
      +
      Use Token Look-Up Function to eliminate categorical repetition
      +
      Use BOOST_PP_REPEAT_2ND to avoid O(N*N) repetition
      +
      Use BOOST_PP_IF to implement special case for the first element
      +
      Use arithmetic, logical and comparison operations when necessary
      +
      +
      +
      +
      +

      Motivation

      +

      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.

      @@ -475,14 +486,15 @@ SPECIAL_NUMBERED_LIST(3,3,E,S)
      +

      Revised + + +

      +

      © Copyright Housemarque Oy 2002

      -

      - -

      © Copyright Housemarque Oy 2001

      -

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

      -

      Updated:

      - - +

      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.

      + +