[GiNaC-list] Bug with evalm()?

Ondrej Certik ondrej at certik.cz
Sun Mar 25 22:35:00 CEST 2007


> my question is this: do you know, if it is possible to implement the
> above procedure in C++? and how? maybe using some macros? Because it
> is certainly non standard, that you construct an instance of some
> class Add(x,x) and it returns an instance of a completely different
> class Mul(2,x).

Well, one solution is to define all the C++ classes as Add_, Mul_,
etc. and then have a macro (or a function) Add, Mul, that will
construct an instance of Add_ and then return Add_.eval().

But it's not very elegant....

Ondrej


More information about the GiNaC-list mailing list