| 18 |
:: |
Scope Resolution |
- |
| () |
Brackets |
| 17 |
a() |
Function call |
Left to right |
| a[] |
Subscript (e.g. indexing of arrays) |
| -> |
Accessing pointers |
| . |
Accessing structs, objects, etc. |
| i++ |
Suffix increment |
| i-- |
Suffix decrement |
| type() |
Functional casts, static_cast, const_cast, etc |
| 16 |
+ - |
Algebraic sign (unary plus and minus) |
Right to left |
| ! |
Logical NOT |
| ~ |
Bitwise NOT |
| ++i |
Prefix increment |
| --i |
Prefix decrement |
| & |
Address operator |
| * |
Dereference |
| (type) |
C-cast |
| sizeof |
Sizeof |
| new, new[] |
Memory allocation |
| delete, delete[] |
Memory deallocation |
| 15 |
.* |
Pointer-to-member |
Left to right |
| ->* |
Pointer-to-member |
| 14 |
* |
Multiplication |
Left to right |
| / |
Division |
| % |
Modulo |
| 13 |
+ - |
Addition and substraction |
Left to right |
| 12 |
<< >> |
Shifting |
Left to right |
| 11 |
< <= > >= |
Comparison |
Left to right |
| 10 |
== != |
Equal and not-equal |
Left to right |
| 9 |
& |
bitwise AND |
Left to right |
| 8 |
^ |
bitwise XOR |
Left to right |
| 7 |
| |
bitwise OR |
Left to right |
| 6 |
&& |
logical AND |
Left to right |
| 5 |
|| |
logical OR |
Left to right |
| 4 |
= |
Assignment |
Left to right |
| *= /= %= += -= &= ^= |= <<= >>= |
Compound assignment |
| 3 |
a ? b : c |
Conditional operator |
Right to left |
| 2 |
throw |
throw operator |
Left to right |
| 1 |
, |
Comma operator |
Left to right |