I am trying to solve differential equations involving matrices like y=A*x+B*u. Here y, x, u are vectors while A, B are matrices.
Okay. So, get started programming.

The expression yields a very definite tree which can be exploited by specialization to create not a single temporary of a class type (only native temporaries are necessary) if only you are willing to do the work.

However, expression templates handle vectors element-by-element.
No. They don't.

The "express templates" technique only generates a tree representation of an expression. It is your job, as the programmer, to parse the tree as you see fit.



If this is the only way that a run-time solution is lacking for you, then I would just write a function that solves differential equations and call it done.
That is ultimately what he should do even if he uses "expression template".

The "expression templates" technique allows him to use operators to express the mathematics which should ultimately be manipulated for use as parameters to a "normal" implementation of the algorithms which exploits the fact that the entire expression is known.

Soma