I have two C++-classes A and B that I can't change for various reasons. However, I'd like to be able to define a multiplication a*a
and a*a
. (Think of A as a rotation matrix and b as a vector). I of course could define a mult(const A& a, const B& b)
but that gets unreadable if I have expressions like a*a'*b
.
Is there a way to overload the *-operator for these classes without changing their code?
(If this is not possible, was there ever a discussion to add this feature to the language?)