Re: [eigen] Lazy evaluation bug, feature, or PEBKAC?

[ Thread Index | Date Index | More lists.tuxfamily.org/eigen Archives ]


2011/3/3 Eamon Nerbonne <eamon@xxxxxxxxxxxx>:
> Hi all,
>
> C++0x is going to happen, and this particular bug (even if user caused) will
> be easier to make since auto is so attractive for templated types one (as a
> programmer) doesn't well understand.  Despite the low runtime cost, there
> still is a motivation to do this just to simplify complicated expressions
> without binding expression decomposition to expression evalutation strategy
> (probably not common, but I could see myself doing this).  If I understand
> correctly, without explicit eval, this will work in eigen3 - right?  And
> with explicit eval, even doing "const auto &" won't be enough?

That's my current understanding too. I wouldn't worry too much about
it. Once the expression evaluator is implemented
(http://eigen.tuxfamily.org/bz/show_bug.cgi?id=99), expression objects
will never ever have to store temporaries by reference,  so AFAIU
there will be no problem. I don't know if there will still be crashes
if the user explicitly calls eval(), but that would not be our fault
--- if the user explicitly creates temporaries with eval(), it's his
responsibility to understand their lifetime.

Benoit



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/