opStar

Janice Caron caron800 at googlemail.com
Sat Nov 10 06:27:30 PST 2007


On 11/10/07, Bruce Adams <tortoise_74 at yeah.woo.co.uk> wrote:
> I think this is one reason why C++ has . & -> and you can never overload .

Historically, C came before C++. In C, a->b was simply an abbreviation
for (*a).b, so when C++ came along, there was something to overload.

In D, we use a.b as the abbreviation for (*a).b - at least for
pointers. But I accept that it probably can't be made to work for
non-pointers.

> Smart pointers will have to be done a different (and hopefully better)
> way in D.

Well here's to that. Looking forward to finding out what it is.



More information about the Digitalmars-d mailing list