Storing expression template functors
Posted
by UncaughtException
on Stack Overflow
See other posts from Stack Overflow
or by UncaughtException
Published on 2010-03-19T10:22:14Z
Indexed on
2010/03/19
10:31 UTC
Read the original article
Hit count: 212
Hello guys,
at the moment I'm really interested in expression templates and want to code a library for writing and differentiating mathematical functions with a lambda-style syntax. At the moment, I'm able to write (_x * _x)(2);
and get the correct result 4. But I would really like to do something like MathFunction f = _x * _x; f(2);
, but I don't have any ideas on how to cope with the recursive expression templates on the right side. Is it possible to achieve this without using the 'auto'-Keyword instead of MathFunction or having to make the operator() virtual?
Thanks for your help!
© Stack Overflow or respective owner