Well, here you have the first problem. Code semantics are being hidden away, making the code less clear. And isn't this precisely what should be avoided on a strongly typed language? And wouldn't that just complicate the compiler's life too?
I believe we can agree (*ptr).member() needs an alternative. However, I don't think it ever crossed anyone's mind to replace it with the dereference operator simply because there is important information that suddenly is lost and a semantics contract being broken.
Absolutely not! :)Quote:
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.
You may look at references as const pointers, but regardless of how they are implemented by the compiler, their semantics are vastly different. A reference is never dereferenced. Or to put it bluntly, a reference is not a pointer, it is a reference.