I want to overload the '^' operator so it will return a Factor of the same type of itself. Ie:Code:class Factor { void func() =0; } class Function : public Factor; class Variable : public Factor;
I don't want to have to overload for every derived class of Factor. Is there anything I can do?Code:Factor operator^(const Factor& x, const double y);