Behavior of opEquals

deadalnix via Digitalmars-d digitalmars-d at puremagic.com
Wed Sep 9 15:44:49 PDT 2015


On Saturday, 5 September 2015 at 09:44:13 UTC, Jacob Carlborg 
wrote:
> On 2015-09-05 08:18, Jonathan M Davis wrote:
>
>> There is nothing in the spec about supporting operator 
>> overloading with
>> free functions, so I don't know where you get the idea that 
>> it's even
>> intended to be a feature. UFCS applies to functions which use 
>> the member
>> function call syntax, and operators aren't used that way. 
>> There is no
>> plan whatsoever to support operator overloading via free 
>> functions.
>
> Since "a == b" would be lowered to "a.opEquals(b)" one could 
> argue that the compile would also try UFCS since it would do 
> that if the code had been "a.opEquals(b)" from the beginning.

The voice of reason.


More information about the Digitalmars-d mailing list