Type Names in Class Scope

Type names defined within class scope are considered local to their class. They cannot be used outside that class. The following example demonstrates this concept:

// type_names_in_class_scope.cpp
// C2146 expected
class Tree {
public:
   typedef Tree * PTREE;
   PTREE  Left;
   PTREE  Right;
   void  *vData;
};

PTREE pTree;  // not in class scope

See Also

Reference

Classes, Structures, and Unions