|
Boost : |
From: Jeremy Siek (jsiek_at_[hidden])
Date: 2001-06-28 12:02:32
The review for the PREPROCESSOR library starts today, June 28 and will
continue until July 9.
The PREPROCESSOR library can be found in the files section of
the boost egroups:
http://groups.yahoo.com/group/boost/files/PREPROCESSOR/
We strongly encourage everyone to take some time to look at this library
and post a review to the boost mailing list. The guidelines for writing a
review can be found here:
http://www.boost.org/more/formal_review_process.htm
The following is a summary of the library.
On Thu, 28 Jun 2001, Vesa Karvonen wrote:
>
> ### BEGIN LIBRARY DESCRIPTION ###
>
> 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 argument lists and make libraries
> configurable through preprocessor definitions.
>
> ### END LIBRARY DESCRIPTION ###
>
>
> ### BEGIN NOTABLE LIBRARY PRIMITIVES ###
>
> BOOST_PREPROCESSOR_UNUSED
> Expands to nothing. Can be used as a macro parameter while generating, for
> instance, cv qualified functions.
>
> BOOST_PREPROCESSOR_CAT(LHS,RHS)
> Delays the catenation of LHS and RHS making it possible to catenate the
> expansions of macros.
>
> BOOST_PREROCESSOR_REPEAT(N, M, P0, P1)
> Repeats the macro M(I, P0, P1).
>
> BOOST_PREPROCESSOR_2ND_REPEAT(N, M, P0, P1)
> Same as REPEAT but uses a separate implementation. Makes it possible to
> perform 2D repetition.
>
> BOOST_PREPROCESSOR_INC(X)
> Increments X. Makes it possible to do primitive computation with the
> preprocessor.
>
> BOOST_PREPROCESSOR_DEC(X)
> Decrements X. Makes it possible to do primitive computation with the
> preprocessor.
>
> BOOST_PREPROCESSOR_IF(C, THEN, ELSE)
> Expands to THEN if C != 0 and ELSE if C == 0. Makes it possible to special
> case the first element of a list.
>
> BOOST_PREPROCESSOR_COMMA_IF(C)
> Expands to a comma if C != 0 and nothing if C == 0. Makes it convenient to
> generate comma separated lists.
>
> BOOST_PREPROCESSOR_ENUM_PARAMS(N, PARAM)
> BOOST_PREPROCESSOR_ENUM_PARAMS_WITH_A_DEFAULT(N, PARAM, DEFAULT)
> BOOST_PREPROCESSOR_ENUM_PARAMS_WITH_DEFAULTS(N, PARAM, DEFAULT)
> These macros facilitate generating parameter lists.
>
> BOOST_PREPROCESSOR_ENUM_SHIFTED_PARAMS(N, PARAM)
> This macro facilitates generating shifted parameter lists.
>
> ### END NOTABLE LIBRARY PRIMITIVES ###
----------------------------------------------------------------------
Jeremy Siek www: http://www.lsc.nd.edu/~jsiek/
Ph.D. Candidate, IU B'ton email: jsiek_at_[hidden]
Summer Manager, AT&T Research phone: (973) 360-8185
----------------------------------------------------------------------
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk