A new blog article detailing the alternative function syntax

Jonathan M Davis jmdavisProg at gmx.com
Fri Aug 9 04:46:08 PDT 2013


On Friday, August 09, 2013 12:25:25 Rory McGuire wrote:
> Quick question: does UFCS allow you to make a type implement an interface?

No. _All_ that UFCS does is take

auto result = foo.bar(args);

and lower it to

auto result = bar(foo, args);

It's purely syntactic sugar, much as that sugar has some great benefits for 
generic code. For a class to implement an interface method, that method must 
actually be part of the class or one of its base classes.

- Jonathan M Davis


More information about the Digitalmars-d-announce mailing list