Operators are tokens that trigger some computation when applied to variables and other objects in an expression.
Arithmetic
Assignment
Bitwise
C++ specific
Comma
Conditional
Equality
Logical
Postfix Expression Operators
Primary Expression Operators
Preprocessor
Reference/Indirect operators
Relational
sizeof
typeid
All operators can be overloaded except the following:
- . C++ direct component selector
- .* C++ dereference
- :: C++ scope access/resolution
- ?: Conditional
Depending on context, the same operator can have more than one meaning. For example, the ampersand (&) can be interpreted as:
- a bitwise AND (A & B)
- an address operator (&A)
- in C++, a reference modifier
Note: No spaces are allowed in compound operators. Spaces change the meaning of the operator and will generate an error.