operator overloading outside the type

Araq rumpf_a at web.de
Sat Mar 29 20:23:21 UTC 2025


On Saturday, 29 March 2025 at 19:06:18 UTC, Walter Bright wrote:
>
> Nobody understands C++ the language, and far too many C++ code 
> bases are incomprehensible.
>

There is no reason to assume that D fares better than C++ here if 
D had the same amount of users... If anything arbitrary 
restrictions wrt operator overloading make D harder to 
understand. Plus as others have pointed out, the compiler cannot 
enforce the semantics of an overloaded plus operator whatsoever.

Also, on top of all that, there is no evidence that people think 
"operators are not functions", many people do think that as that 
is just the truth. What you do here is you let some random set of 
anecdotes guide your language design.


More information about the Digitalmars-d mailing list