Path: utzoo!utgpu!watserv1!watmath!att!att!linac!pacific.mps.ohio-state.edu!zaphod.mps.ohio-state.edu!usc!cs.utexas.edu!uunet!microsoft!jimad From: jimad@microsoft.UUCP (Jim ADCOCK) Newsgroups: comp.lang.c++ Subject: Re: Base class access: by name only? Message-ID: <59306@microsoft.UUCP> Date: 26 Nov 90 19:25:20 GMT References: <1990Nov19.012937.27283@Neon.Stanford.EDU> Reply-To: jimad@microsoft.UUCP (Jim ADCOCK) Organization: Microsoft Corp., Redmond WA Lines: 36 In article <1990Nov19.012937.27283@Neon.Stanford.EDU> philip@pescadero.stanford.edu writes: |In some other object-oriented languages, it is possible to access the |superclass (base class in C++) without using its name. In C++, it seems |you have to use the base class name to get to a member redefined in the |current class. This strikes me as inconvenient; if I redesign my class |hierarchy, I have to remember to edit such occurences of base class names |as needed. Am I missing something, Yes, languages that allow accessing a superclass without using its name only allow single superclasses. If you have multiple superclasses you need to be able to specify *which* super class -- the obvious way to do this is by using the superclasses name. Which is exactly the convention C++ chose. |or is this a serious limitation? Nor is this a serious limitation. Many C++ programmers who have chosen to restrict themselves to using single inheritence [most of these people presumably being from a Smalltalk background] then choose to define "super" for use in their derivations: class Base { // .... }; #define SUPER base class derived: public SUPER { // Use the SUPER word }; Seems to me that if one refactors the class heirachy changing super classes, hiding the super class name is going to be the *least" of one's problems!