opStar

Walter Bright newshound1 at digitalmars.com
Sat Nov 10 21:42:07 PST 2007


Janice Caron wrote:
> So, we can write p.m for real pointers, but we have to write (*p).m
> for classes that implement opStar()? That seems inconsistent.

Not really. You cannot overload references in C++, either.

> What's opStar for, if not to implement iterators?

For iterators. Should a class be used as an iterator? I can't see how 
that would make sense anyway.



More information about the Digitalmars-d mailing list