1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114
|
/**
\page doc_operator_precedence Operator precedence
In expressions, the operator with the highest precedence is always computed first.
\section unary Unary operators
Unary operators have the higher precedence than other operators, and between unary operators the operator closest to the actual value has the highest precedence. Post-operators have higher precedence than pre-operators.
This list shows the available unary operators.
<table cellspacing=0 cellpadding=0 border=0>
<tr><td width=150 valign=top>
<code>::</code>
</td><td valign=top>
scope resolution operator
</td></tr><tr><td width=150 valign=top>
<code>[]</code>
</td><td valign=top>
indexing operator
</td></tr><tr><td width=150 valign=top>
<code>++ \--</code>
</td><td valign=top>
post increment and decrement
</td></tr><tr><td width=150 valign=top>
<code>.</code>
</td><td valign=top>
member access
</td></tr><tr><td width=150 valign=top>
<code>++ \--</code>
</td><td valign=top>
pre increment and decrement
</td></tr><tr><td width=150 valign=top>
<code>not !</code>
</td><td valign=top>
logical not
</td></tr><tr><td width=150 valign=top>
<code>+ -</code>
</td><td valign=top>
unary positive and negative
</td></tr><tr><td width=150 valign=top>
<code>~</code>
</td><td valign=top>
bitwise complement
</td></tr><tr><td width=150 valign=top>
<code>@ </code>
</td><td valign=top>
handle of
</td></tr>
</table>
\section binary Binary and ternary operators
This list shows the dual and ternary operator precedence in decreasing order.
<table cellspacing=0 cellpadding=0 border=0>
<tr><td width=200 valign=top>
<code>**</code>
</td><td width=350 valign=top>
exponent
</td></tr><tr><td valign=top>
<code>* / %</code>
</td><td valign=top>
multiply, divide, and modulo
</td></tr><tr><td valign=top>
<code>+ -</code>
</td><td valign=top>
add and subtract
</td></tr><tr><td valign=top>
<code><< >> >>></code>
</td><td valign=top>
left shift, right shift, and arithmetic right shift
</td></tr><tr><td valign=top>
<code>&</code>
</td><td valign=top>
bitwise and
</td></tr><tr><td valign=top>
<code>^</code>
</td><td valign=top>
bitwise xor
</td></tr><tr><td valign=top>
<code>|</code>
</td><td valign=top>
bitwise or
</td></tr><tr><td valign=top>
<code><= < >= ></code>
</td><td valign=top>
comparison
</td></tr><tr><td valign=top>
<code>== != is !is xor ^^</code>
</td><td valign=top>
equality, identity, and logical exclusive or
</td></tr><tr><td valign=top>
<code>and &&</code>
</td><td valign=top>
logical and
</td></tr><tr><td valign=top>
<code>or ||</code>
</td><td valign=top>
logical or
</td></tr><tr><td valign=top>
<code>?:</code>
</td><td valign=top>
condition
</td></tr><tr><td valign=top>
<code>= += -= *= /= %= **= &=<br>
|= ^= <<= >>= >>>=</code>
</td><td valign=top>
assignment and compound assignments
</td></tr>
</table>
*/
|