This chapter contains a description of the operators used in SC. Most of them may be defined for user types.
Priority | Operator | Description | Associativity | Overloadable |
---|---|---|---|---|
15 | . | member access through reference | left to right | no |
15 | -> | member access through pointer | left to right | no |
15 | [] | array element access | left to right | no |
15 | () | function call | left to right | no |
15 | new | managed memeory allocation | left to right | no |
15 | (T) | typecast to type T | right to left | yes |
15 | $ | rtti (ISCSymbol) access | left to right | no |
15 | * | dereferencing pointer | right to left | no |
15 | & | address of variable | right to left | no |
14 | ++ | postfix increment | left to right | yes |
14 | ++ | prefix increment | right to left | yes |
14 | -- | postfix decrement | left to right | yes |
14 | -- | prefix decrement | right to left | yes |
14 | ~ | bitwise negation | right to left | yes |
14 | ! | logical negation | right to left | yes |
14 | - | unary minus | right to left | yes |
13 | * | multiplication | left to right | yes |
13 | / | division | left to right | yes |
13 | % | modulus | left to right | yes |
12 | + | addition | left to right | yes |
12 | - | subtraction | left to right | yes |
11 | >> | bitwise left shift | left to right | yes |
11 | << | bitwise right shift | left to right | yes |
10 | < | less - comparison operator | left to right | yes |
10 | <= | less or equal - comparison operator | left to right | yes |
10 | > | greater - comparison operator | left to right | yes |
10 | >= | greater or equal - comparison operator | left to right | yes |
9 | == | equal - comparison operator | left to right | yes |
9 | != | not equal - comparison operator | left to right | yes |
8 | & | bitwise and | left to right | yes |
7 | ^ | bitwise xor | left to right | yes |
6 | | | bitwise or | left to right | yes |
5 | && | logical and | left to right | yes |
4 | || | logical or | left to right | yes |
2 | = | assignment | left to right | yes |
2 | += | assignment with addition | left to right | no |
2 | -= | assignment with subtraction | left to right | no |
2 | *= | assignment with multiplication | left to right | no |
2 | /= | assignment with division | left to right | no |
2 | %= | assignment with modulus | left to right | no |
2 | <<= | assignment with bitwise left shift | left to right | no |
2 | >>= | assignment with bitwise left shift | left to right | no |
2 | &= | assignment with bitwise and | left to right | no |
2 | |= | assignment with bitwise or | left to right | no |
2 | ~= | assignment with bitwise negation | left to right | no |
1 | , | comma | left to right | no |