UFCS idea

Dmitry Olshansky dmitry.olsh at gmail.com
Wed Jun 8 13:40:14 PDT 2011


On 09.06.2011 0:39, Timon Gehr wrote:
> 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.
Me thinks it should be counted as another overload, and be resolved in 
the same way - partial ordering, and report ambiguity if can't choose 
one. Less special casing.
> Timon


-- 
Dmitry Olshansky



More information about the Digitalmars-d mailing list