Syntax
primary_expression:
literal
this
:: identifier
:: operator_name
:: qualified_name
(expression)
member_name
member_name:
identifier
operator_name
conversion_function_name
~class_name
qualified_name
qualified_name:
qualified_class_name :: member_name
Notes
- A literal is a primary expression whose type depends upon its form.
- Within the body of a non-static method,
the this pointer points to the instance of the class for which
the method was invoked. The this pointer is a primary expression that may be referenced only from
within a non-static class method.
- When the global scope operator (::) is followed by an identifier,
an operator name or a
qualified name, the result is a primary expression whose type is
the same as the named object. The named object must be of file scope.
The result is an lvalue only if the named object is an lvalue.
- An expression enclosed by parentheses is a primary
expression. The type of the primary expression is the same as that of the expression enclosed within the parentheses.
- A member name is a primary expression that may appear after one of the
member access operators . or ->.
The following applies to member names.