Why can't structs be derived from?

Jonathan M Davis jmdavisProg at gmx.com
Thu Mar 17 23:17:28 PDT 2011


On Thursday 17 March 2011 22:12:17 Don wrote:
> Andrei Alexandrescu wrote:
> > On 3/17/11 11:21 AM, Andrej Mitrovic wrote:
> >> On 3/17/11, Nick Sabalausky<a at a.a>  wrote:
> >>> I've long been convinced that "alias old new;" should really be
> >>> "alias new =
> >>> old;" The current way confuses me, and I *still* have to consciously
> >>> stop
> >>> and think about it every time I write an alias statement (including
> >>> just now).
> >> 
> >> I thought I was the only one. The `alias symbol this` in structs in
> >> particular always stops me and I have to think about what it means,
> >> even though it might be obvious.
> > 
> > I'm with y'all too. Even Walter needs to stop and think for a second.
> > We're considering enabling
> > 
> > alias a = b;
> > 
> > as an equivalent for
> > 
> > alias b a;
> > 
> > 
> > Andrei
> 
> That would be great!

Yes. That change would make alias much more pleasant to deal with. It's not all 
that big a deal with how it is, but I usually screw it up, just like I usually 
screw up typedefs in C++. It's just not obvious which way it goes.

- Jonathan M Davis


More information about the Digitalmars-d mailing list