共用方式為


Qualified Names

Specifies the scope.

qualified-class-name :: name

Remarks

If a qualified-class-name is followed by the scope-resolution operator (::) and then the name of a member of either that class or a base of that class, then the scope-resolution operator is considered a qualified-name. The type of a qualified-name is the same as the type of the member, and the result of a qualified-name expression is the member. If the member is an l-value, then the qualified-name is also an l-value. For information about declaring a qualified-class-name, see Type Specifiers or Class Names.

The class-name part of a qualified-class-name can be hidden by redeclaration of the same name in the current or enclosing scope; the class-name is still found and used. See Scope for an example of how to use a qualified-class-name to access a hidden class-name.

注意

Class constructors and destructors of the form class-name :: class-name and class-name :: ~ class-name, respectively, must refer to the same class-name.

A name with more than one qualification, such as the following, designates a member of a nested class:

class-name :: class-name :: name

See Also

Reference

Primary Expressions