|
Boost : |
From: Eric Niebler (eric_at_[hidden])
Date: 2007-07-23 00:27:48
dan marsden wrote:
> Eric Niebler wrote:
>> Of course, calling deep_copy() in the generator is sub-optimal. Every
>> part of the tree has been deep_copied already except the top-most node.
>> When I find time, I'll write a by_value_generator which makes sure
>> everything in the tree is held by value.
>
> Cool, I'll keep an eye out for by_value_generator.
OK, by_value_generator is implemented now. Usage is:
template<class Expr> struct my_expr;
struct my_domain
: domain<by_value_generator<generator<my_expr> > >
{};
That's two sequenced generators. The first makes sure the child nodes
are held by value, then forwards the result to the second, which wraps
the new node in my_expr<>. The second generator is optional.
-- Eric Niebler Boost Consulting www.boost-consulting.com The Astoria Seminar ==> http://www.astoriaseminar.com
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk