Top 5

Steven Schveighoffer schveiguy at yahoo.com
Wed Oct 8 18:33:55 PDT 2008


"Andrei Alexandrescu" wrote
> Steven Schveighoffer wrote:
>> 4. Tail-const class references (you may say this isn't a bug, but its a 
>> huge hole that needs to be fixed for D const to be useful).
>
> Did you try Rebindable in std.typecons?
>
> http://www.digitalmars.com/d/2.0/phobos/std_typecons.html
>
> Andrei
>

I don't really use D2, so I forgot that opDot makes this possible.  I think 
the last time I looked at it, maybe opDot wasn't included or implemented 
yet.

But that should work fine.  Would be nice to have aliases like:

tailconst!(Widget)
tailinvariant!(Widget)

Which to me feel better than:

Rebindable!(const(Widget))

I'll replace my #4 with overloading based on return values, but that really 
is an enhancement more than a fix ;)

Thanks

-Steve 





More information about the Digitalmars-d mailing list