"instanceOf" trait for conditional implementations

Marco Leise Marco.Leise at gmx.de
Wed Oct 10 05:50:45 PDT 2012


Am Thu, 04 Oct 2012 14:43:00 +0200
schrieb "so" <so at so.so>:

> OT - Is there any reason for disabling UFCS for this?
> 
> template isAssignable(Lhs, Rhs)
> {
>      enum bool isAssignable =
>      {
>          Lhs l = void;
>          void f(Rhs r) { l = r; }
>          return l;
>      }.typeof.is;
> }

Yoda says: "This proposal a special type of is!"

-- 
Marco



More information about the Digitalmars-d mailing list