|
Boost : |
From: Daniel James (daniel_at_[hidden])
Date: 2005-01-31 13:22:34
Hello everyone,
I've been trying out a pre-release of g++ 4.0, and its typeof now works
a lot better than the older versions. This allows it to be used for
metaprogramming. As an example, I've attached a compile time factorial
implemented mainly using operator overloads (it's not commented at all,
but should be pretty easy to understand for most people on this list). I
think it would be possible to write a metaprogramming library which
would have much nicer syntax (borrowing techniques from lamba &
phoenix), and integrate well with mpl.
I suppose that since such a library would only work on gcc for now (or
do any other compilers have a good enough typeof?), it might not be
appropriate for boost, but I thought this might be of interest here anyway.
Daniel
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk