25 Mar
2007
25 Mar
'07
10:35 p.m.
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