Overloading a pointer to a class
I don't think it's possible, but can I overload a pointer to a class? Ie:
Code:
class M
{
public:
M *operator *= (M *);
};
M *M::operator *= (M *param)
{
//Do things by dereferencing
return this;
}
void func(M *a,M *b)
{
a*=b; //This would give characteristics of b to a
}
The operation I want performed has nothing to do with multiplication - it's just a random pick of operator. So, is this possible? I tried it like the above, without success, but maybe I have the syntax wrong?