opStar

Walter Bright newshound1 at digitalmars.com
Sun Nov 11 18:17:56 PST 2007


Bill Baxter wrote:
> Walter Bright wrote:
>> Bill Baxter wrote:
>>> If you're not going to be able to access members and such via the 
>>> opStar, why not just have iterators use a convention like p.val to 
>>> access the value pointed too, rather than *p.  Why does it need to be 
>>> an operator?
>>
>> Because raw pointers don't have a .value property, and can't because
>> then you'd have problems with pointers to structs that have a value 
>> member.
> 
> So what about smart pointers?  Do you really just expect everyone to 
> suck it up and get used to writing (*x).foo?

There are other ways to do smart pointers. I happen to strongly dislike 
the C++ way of doing it.



More information about the Digitalmars-d mailing list