Boost logo

Boost Users :

Subject: Re: [Boost-users] [Proto] Evaluating non-trivial expression
From: Eric Niebler (eric_at_[hidden])
Date: 2008-09-30 17:15:49


Joel Falcou wrote:
> Eric Niebler a écrit :
>> Interesting. You might try disabling Proto's comma operator and
>> writing your own that fires off expression evaluations.
>>
> I thought of that but I need the whole AST for checking for various
> stuff. Basically I transform a algebra AST into a a pair of objects :
> a tuples of matrix begin() pointer and a stripped AST so I can
> generate a software pipelined evaluation loop nest.
>
> I tried adding the destructor-based evaluation and it seems to work
> but I fear there may be some side-effects I'll regret later.

Aside from the usual advice against doing stuff in destructors that can
fail ... how do you ensure that only the top-level (outermost) object's
destructor causes an evaluation?

Might it be cleaner to be more explicit about evaluation, e.g., like:

   eval(( a = b+c, u = x + y, z = 3*e ));

?

-- 
Eric Niebler
BoostPro Computing
http://www.boostpro.com

Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net