Safer casts

Janice Caron caron800 at googlemail.com
Tue May 13 01:00:44 PDT 2008


2008/5/13 Yigal Chripun <yigal100 at gmail.com>:
>  >     alias std.algorithm.sort!("b<a") sort_reverse;
>  >     array.sort_reverse;
>  >
>  > Is that close enough?
>
>  I want this alias in the library.

It can't be in the library, because if it were in the library it would
cause the template to instantiate. We don't want it to instantiate if
it's not needed.

(Currently, an alias causes instantiation, even if the alias is not
subsequently used. I don't like that behaviour, but that's how it is
right now).



>  D needs to make it possible
>  to overload built-in properties.

You can't overload something that isn't a class. Overloading requires
inheritance.



More information about the Digitalmars-d mailing list