Operator overloading through UFCS doesn't work

Jakob Ovrum jakobovrum at gmail.com
Sat Oct 13 02:06:27 PDT 2012


On Saturday, 13 October 2012 at 08:36:19 UTC, Tommi wrote:
> Quote from TDPL: "D’s approach to operator overloading is 
> simple: whenever at least one participant in an operator 
> expression is of user-defined type, the compiler rewrites the 
> expression into a regular method call with a specific name. 
> Then the regular language rules apply."

Do note that this says *method* call. Your example doesn't use 
methods. Hence, the current state of operator overloading is 
consistent with TDPL.



More information about the Digitalmars-d-learn mailing list