
Eric Niebler a écrit :
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?
I actually have a flag in the expression that is set when the expression is used as a rhs in operator=. Side effect of doing this is that I can optimize a =b =c+d into a single nest loop instead of one nest loop + memcpying the data. In which cases a destructor can fail ?
Might it be cleaner to be more explicit about evaluation, e.g., like:
eval(( a = b+c, u = x + y, z = 3*e )); It may but it'll break existing code and looks far less intuitive.
___________________________________________ Joel Falcou - Assistant Professor PARALL Team - LRI - Universite Paris Sud XI Tel : (+33)1 69 15 66 35