From: Benedikt Weber (weber_at_[hidden])
Date: 2002-06-30 07:19:17


Joerg

> It's a proven (but not well known ;-) technique to reintroduce
> temporaries at the right places into the expression, i.e. writing A *
vector
> (B * v).

I am glad there is at least a possibility to force the creation of a
temporary. However, the user should not have to be concerned about such
details. I never did anything with expression templates and I only recently
read about them in the context of the Spirit parser. However, I think it
should be possible to change the design so a temporary is automatically
introduced where appropriate (say for the prod() functions). I urge you to
think about a possibility to change that. It would be a real benefit for the
library.

> Yes, I'm currently thinking about changing the interface for prod() to
make
> the above problem more clear.

While personally I would prefer operator* also for matrix/matrix and
matrix/vector product, your prod() has the "advantage" that is more
complicated to write prod(A,prod(B,v)) than A*(B*v) and so users won't write
complicated expressions and not encounter the problem so often. However,
that seems not to be the real solution to me.

Benedikt