Operator overloading through UFCS doesn't work

Marc Schütz via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Fri May 27 02:08:20 PDT 2016


On Thursday, 26 May 2016 at 06:23:17 UTC, Jonathan M Davis wrote:
> The difference is that it's impossible to do 
> 10.opBinary!"+"(15), so if you're forced to do 
> foo.opBinary!"+"(bar) to get around a symbol conflict, it won't 
> work with built-in types.

Well, that begs the question: Why don't built-in types define 
`opBinary`? That's just another arbitrary irregularity, isn't it.


More information about the Digitalmars-d-learn mailing list