Boost logo

Boost :

From: Eric Niebler (eric_at_[hidden])
Date: 2007-06-01 17:56:29


Larry Evans wrote:
>>> for(long ichild=0; ichild<Arity; ++ichild)
>>> {
>>> proto::eval(proto::arg_c<Expr,ichild>(expr), *this);
>>> }

That's really not going to work. If you #include proto/fusion.hpp, you
can use fusion::for_each on the children nodes as follows:

   fusion::for_each( proto::children_of(expr), myfunc() );

> template<long Index>
> void operator()(mpl::integral_c<long,Index>&)
> {
>
> proto::eval(proto::arg_c<Expr,Index>(my_parent),my_context);

And yours is another way to skin the cat, but this line needs to be:

   proto::eval(proto::arg_c<Index>(my_parent),my_context);

HTH,

-- 
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