Why does D change operator precedence according to C/C++ ?

deadalnix deadalnix at gmail.com
Mon Apr 2 03:03:14 PDT 2012


Hi,

I have a design question, or maybe it is a bug ? In D, == and != have 
the same precedence than comparisons operators. This isn't the case in 
C/C++ . Is it a design decision, made on purpose ? Is it a bug ?

DMD implementation and http://dlang.org/expression.html both agree on that.

I personally think it is a bug. This is a change in the behavior of 
C/C++ with no legitimate reason. Or at least with no legitimate reason I 
can come up with.


More information about the Digitalmars-d mailing list