UFCS idea

Timon Gehr timon.gehr at gmx.ch
Wed Jun 8 13:39:46 PDT 2011


Dmitry Olshansky wrote:
>
> what was so bad about having 'this' inside parameters?
> I thought it was rather compelling:
>
> void func(Type1 this, Type2 p2);
> which is legal only as a free function and inside structs/classes it's
declaration syntax error.
>
> [3,2,5,3].cycle.stride(2).take(10); //and no snails :)

Furthermore, it should be illegal to make UFCS clash with a method's name in order
to prevent hijacking.

Timon


More information about the Digitalmars-d mailing list