I'm wondering why operator->() returns a raw poiter to an object when operator*() returns a refence
a->b is supposed to be synctactic sugar for (*a).b and is apparently implemented as:
Code:
(*(a.operator->()).b
or
(a.operator->())->b
where the return of operator->() has to be a raw pointer
wouldn't an implementation as:
whit operator->() returning a reference been more logical? Or even implement it as a macro for (*a).b so that only one dereference operator exists? (while having 2 might be useful for operator overloading, the automatic functionality tacked on to operator-> limits its possible applications)