Names

In the C++ syntax for primary-expression, a name is a primary expression that can appear only after the member-selection operators (. or –>), and names the member of a class.

Syntax

name :

identifier
operator-function-name
conversion-function-name
~ class-name
qualified-name

Any identifier that has been declared is a name.

An operator-function-name is a name that is declared in the form

operator operator-name( argument1 [ , argument2] );

See Overloaded Operators for more information about declaration of operator-function-name.

A conversion-function-name is a name that is declared in the form

operator type-name( )

Note You can supply a derivative type name such as char * in place of the type-name when declaring a conversion function.

Conversion functions supply conversions to and from user-defined types. For more information about user-supplied conversions, see Conversion Functions.

A name declared as ~ class-name is taken as the “destructor” for objects of a class type. Destructors typically perform cleanup operations at the end of an object’s lifetime. For information on destructors, see Destructors .