Topic: Nested classes


Author: larsn@Autodesk.COM (Lars Nyman)
Date: 15 Apr 93 22:40:46 GMT
Raw View
Is the following legal:

 class foo {};

 class bar {
    class foo : public ::foo {};  // (*)
 };

Sun C++ (cfront 3.0) and VC++ complains at (*) about foo being derived from
itself.

Assuming the global foo is an abstract class, it may be useful to "reuse
its name" when providing an implementation.