Operator overloading through UFCS doesn't work

Maxim Fomin maxim at maxim-fomin.ru
Sat Oct 13 23:13:22 PDT 2012


On Saturday, 13 October 2012 at 22:34:19 UTC, H. S. Teoh wrote:
> OK, before this thread devolves into a shouting match, I'd like 
> to
> understand what was the rationale behind this restriction. What 
> were the
> reasons behind not allowing a non-member function to overload an
> operator? What are the pros and cons considered at the time, 
> and how do
> they weigh now? Or was it just a matter of not being 
> implemented because
> nobody thought about it at the time?
>
>
> T

It likely was not implemented rather than disallowed. The only 
mentioned reason is to allow writing operator overloading methods 
outside type scope - just because somebody (currently two people) 
consider it logical to broaden UFCS usage. This doesn't solve ay 
practical issue.


More information about the Digitalmars-d-learn mailing list