Originally Posted by
brewbuck
I think the question was more along the lines of, the compiler does in fact know whether the variable is a pointer or an object, so why can't it apply an implicit dereference if it's a pointer? Then we would say "obj.foo()" and "ptrToObj.foo()" in either case. In other words, if the LHS is a pointer, magically transform "." into "->".
After thinking a bit, I can't come up with a compelling reason why it couldn't have been done that way. At first I thought it might negatively impact code clarity, by making it impossible to tell at a glance whether the LHS is a pointer or an object. But if you accept that argument, then you should also accept that C++ references are equally confusing because they "magically" dereference themselves wherever they are used, and are difficult to distinguish in precisely the same way.
I happen to think that C++ references are NOT confusing, and similarly, I don't think it would be confusing to have a single operator for member access in both objects and pointers, but that just isn't how it is, and it is never going to change.