restrict alias this?

Simen Kjaeraas simen.kjaras at gmail.com
Sun Apr 29 04:24:01 PDT 2012


On Sun, 29 Apr 2012 10:14:09 +0200, Namespace <rswhite4 at googlemail.com>  
wrote:

> Based on my previous thread  
> (http://forum.dlang.org/thread/rpcqefmyqigftxsgsqui@forum.dlang.org), I  
> got the question whether it is possible to restrict "alias this"?
> Similar to templates function, e.g. "void foo(T)(T value) if  
> (isNumeric!(T) ...", but it should be limited here so that it does not  
> interact with the cast or something other.
> As far as I know, "alias this" is an implicit cast. And just like an  
> explicit cast (opCast) it should be possible to restrict it.
>
> Otherwise, I have unfortunately run out of ideas how I can allow an  
> implicit conversion.

What do you mean restrict it?


More information about the Digitalmars-d-learn mailing list