
7 Mar
2011
7 Mar
'11
2:12 p.m.
On Mon, 07 Mar 2011 08:52:23 +0100 Joel Falcou <joel.falcou@lri.fr> wrote:
How would the expression's code know anything about x, or have access to its allocated memory? If the template is operator+, you'd have to pass x to it somehow. If it's not, operator+ would have to allocate some memory for a temporary, wouldn't it?
x just have a operator= taking a interge_expression<X> type whcich contains the whole a+b abstract syntax tree. From there, there is countless techniques to iterate over the AST, transform it or evaluate it as code.
Ahhhh... that's an application I'd never considered. I'll have to look into it. Thank you. -- Chad Nelson Oak Circle Software, Inc. * * *