|
Boost : |
From: Eric Niebler (eric_at_[hidden])
Date: 2007-04-27 11:59:42
Maurizio Vitale wrote:
>
> The example calc3 was the one that cleared things up for me: there
> only apply is defined, but more importantly comments around the
> commented out call() method talks about the unneeded 'run-time
> counterpart for the transform'. I think this dichotomy should be made
> more clear in the documentation.
Thanks for the feedback.
> An example where the runtime part does more than just reifying the
> compiletime side, by generating more complex code might also be usful.
I agree. I need an example where the call() function actually does
something. I also need to show the State parameter getting used. Maybe
I'll show how the fold_to_list<> transform works. FYI, it converts
expressions like:
a >> b >> c
or
a | b | c
to fusion cons lists like:
cons< a, cons< b, cons< c > > >
> I might have something that computes code for overflow handling and/or
> (more complex) quantization handling, if only I could make it work
> with proto...
You might look at the fold<> transform (I suggest you run the sources
through the preprocessor first). And then try to wrap your head around
the fold_to_list<> transform to see how the runtime component of the
transform works. Once you understand that, you'll know proto's
transforms inside and out.
-- Eric Niebler Boost Consulting www.boost-consulting.com
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk