This section describes C++ expressions. Expressions are sequences of operators and operands that are used for one or more of these purposes:
- Computing a value from the operands.
- Designating objects or functions.
- Generating "side effects." (Side effects are any actions other than the evaluation of the expression — for example, modifying the value of an object.)
In C++, operators can be overloaded and their meanings can be user-defined. However, their precedence and the number of operands they take cannot be modified. This section describes the syntax and semantics of operators as they are supplied with the language, not overloaded. In addition to types of expressions and semantics of expressions, the following topics are covered:
- Primary expressions
- Scope resolution operator
- Postfix expressions
- Expressions with unary operators
- Expressions with binary operators
- Conditional operator
- Constant expressions
- Expressions with explicit type conversions
- Casting operators
- Run-time type information
Topics on operators in other sections:
- Table of C++ operators
- Overloaded operators
- __typeof operator
Note Operators for built-in types cannot be overloaded; their behavior is predefined.