Overloading relational operators separately; thoughts?

Walter Bright via Digitalmars-d digitalmars-d at puremagic.com
Wed Sep 28 21:15:32 PDT 2016


On 9/28/2016 1:40 PM, Timon Gehr wrote:
> What's wrong with that usage?

Because then something other than comparison is happening with <=, <, >, >= and 
there'll be nothing in the code to give the user a hint.


> (This is NOT expression templates.)

Right, but it's an enabler of expression templates. Discussion of more powerful 
operator overloading cannot be divorced from expression templates, and once ETs 
are in we'll be stuck with them forever.


D has many very powerful modeling abilities, but so far we've tried to stay away 
from things that make context-free user understanding of code unduly difficult. 
It should not be necessary to use an IDE to understand code.

In that category are things like text macros, AST macros, user-defined syntax, 
non-arithmetic operator overloading, and expression templates.


More information about the Digitalmars-d mailing list