I can't for the life of me figure out the correct way to overload the operators -> and ->*.
I know that the standard library iterators do it, and that auto_ptr and various other smart pointer classes do it. I can't seem to find any useful documentation on the subject and was hoping someone here might be able to explain how to do this right.
The first point of confusion is the parameter. I would think that the operator would take a member pointer, but that would necessitate overloading for every member function signature and member data type. This seems stupid and I doubt it is correct, but I can't think of anything else.
Secondly, what should this operator return? Should it return anything at all? The return type of the function you invoke? Maybe the data type of the member you access?