在http://www.digitalmars.com/d/1.0/expression.html页面中,显示较高的内容通常具有较低的优先级.要获取特定优先级,请遵循解析器规则.
15. typeof() typeid() is()
assert() import() mixin()
function delegate
T.x x!y
variables
(...) [...] //(Primary expressions)
"x" "y" //(Concatenation between string literals)
14. . x++ x--
x() x[] //(Postfix operators)
13. & ++x --x *
+x -x ! ~ (T).
new delete
cast //(Prefix operators)
12½. ^^ //(Power. D2 only)
12. * / % ///(Multiplicative operators)
11. + - ~ //(Additive operators)
10. >> << >>> //(Bitwise shift)
9. == != is !is
> < >= <=
!> !< !>= !<=
<> !<> <>= !<>=
in !in //(Comparison operators)
8. & //(Bitwise AND)
7. ^ //(Bitwise XOR)
6. | //(Bitwise OR)
5. && //(Logical AND)
4. || //(Logical OR)
3. ?: //(Conditional operator)
2. op= //(Assignment operator)
1?. => //(Lambda. D2 only. Not really an operator)
1?. .. //(Slicing. Not really an operator)
1. , //(Comma operator)
Run Code Online (Sandbox Code Playgroud)