Show: Object Pascal C++
Display Preferences

Primary Expression Operators

From Appmethod Topics
Jump to: navigation, search

Go Up to Operators Summary

For ANSI C, a primary expression is literal (also sometimes referred to as constant), identifier, and ( expression ). The C++ language extends this list of primary expressions to include the keyword this, scope resolution operator ::, name, and the class destructor ~ (tilde).

The primary expressions are summarized in the following list.

   qualified-name: (C++ specific)
   qualified-class-name :: name

For a discussion of the primary expression this, see this (keyword). The keyword this cannot be used outside a class member function body.

The scope resolution operator :: allows reference to a type, object, function, or enumerator even though its identifier is hidden.

The parentheses surrounding an expression do not change the unadorned expression itself.

The primary expression name is restricted to the category of primary expressions that sometimes appear after the member access operators . (dot) and ->. Therefore, name must be either an lvalue or a function. See also the discussion of member access operators.

An identifier is a primary expression, provided it has been suitably declared. The description and formal definition of identifiers is shown in Identifiers.

See the discussion on how to use the destructor operator ~ (tilde).

See Also

Personal tools
In other languages