Re: Generic "expression template" library?
On Feb 8, 8:56 am, Daniel Pitts
<newsgroup.spamfil...@virtualinfinity.net> wrote:
Are there any popular expression template libraries that
support all/most arithmetic operators, and that allow
"compound" expressions to be created?
for example...
template<typename A, typename B>
struct Multiply;
template<typename A, typename B>
struct Add;
x = Multiply<double, double>(1,3) + 4;
where x might be of type Add<Multiply<double, double>, int>.
I was thinking of creating my own, but if there is an existing
one that handles all the odd cases (such as avoiding infinite
recursion), all the better.
http://www.oonumerics.org/blitz/? I'm not too familiar with
this library, as I don't work in numerical processing, but from
what I understand, it is the reference for this sort of thing.
(The original author, Todd Veldhuizen, is one of the inventors
of template metaprogramming.)
I do think, however, that it expects overloaded operators,
rather than named obejcts (like Multiply).
--
James Kanze (GABI Software) email:james.kanze@gmail.com
Conseils en informatique orient=E9e objet/
Beratung in objektorientierter Datenverarbeitung
9 place S=E9mard, 78210 St.-Cyr-l'=C9cole, France, +33 (0)1 30 23 00 34