Simple operator precidence chart (and associativity)?

Jonathan M Davis jmdavisProg at gmx.com
Tue Mar 13 17:19:05 PDT 2012


On Tuesday, March 13, 2012 18:29:03 Nick Sabalausky wrote:
> I'm reading through D's grammar spec, and maybe it's just not enough sleep
> or some such, but my brain is turning to mud:
> 
> Is there a simple operator precidence chart somewhere? (Also, for
> associativity: Assign and OpAssign are right-associative and everything else
> is left-associative, correct?)

For all of the operators which come from C/C++, the operator precendence chart 
from C/C++ should work:

http://en.cppreference.com/w/cpp/language/operator_precedence

It's how the D-specific ones fit in that gets harder to figure out. IIRC TDPL has 
an operator precedence table though, so you should be able to look there.

- Jonathan M Davis


More information about the Digitalmars-d-learn mailing list