$include_dir="/home/hyper-archives/boost-users/include"; include("$include_dir/msg-header.inc") ?>
From: Pavel Vozenilek (pavel_vozenilek_at_[hidden])
Date: 2005-05-14 14:40:42
"martin f krafft" wrote:
> Some of my code includes the following (abbreviated):
>   typedef Edge<Node0000Type, Node0000Type> Edge00000000Type;
>   typedef Edge<Node0000Type, Node0001Type> Edge00000001Type;
>   typedef Edge<Node0000Type, Node0010Type> Edge00000010Type;
>   typedef Edge<Node0000Type, Node0011Type> Edge00000011Type;
>   //... you can imagine where this is going.
>
> Instead of 32 typedefs, I was wondering if it weren't possible to
> use the compiler to achieve the above.
>
> Similarly, let's say I wanted to define a set of empty classes:
>
>   class AB : public A, B {};
>   class AC : public A, C {};
>   class BC : public B, C {};
>
> can I use the compiler to automate this?
>
Boost.Preprocessor:
http://www.boost.org/libs/preprocessor/doc/index.html
Introduction to the library:
http://boost-consulting.com/tmpbook/preprocessor.html
It takes some effort to get used to using the library
but it is worth of the time, IMHO.
/Pavel