Little demo of allowing basic types to implement interfaces.

Dicebot public at
Wed Sep 4 02:01:18 PDT 2013

On Wednesday, 4 September 2013 at 08:44:45 UTC, Rory McGuire 
> yes, it does seem to break if the Implements template func is 
> in a
> different module to the free standing func.
> hmph, how to get around that.

I don't think it is possible. You can possibly have several 
modules with free standing functions with same signature which 
will match UFCS - how one may determine in general case which one 
to check against? Only way is to locally clone imports from the 
scope `Implements` is called from and I am not aware of any 
mechanism to do it.

Well, one can always switch to string mixins of course and invade 
caller scope but that is not clean by any means.

More information about the Digitalmars-d-announce mailing list