Topic: super / base / parent keyword


Author: ebeyeler_g@yahoo.com (Eric Beyeler)
Date: Fri, 12 Dec 2003 00:51:58 +0000 (UTC)
Raw View
I would like to bring up this issue again. I found a few scattered
posts in the archives, but I would be interested in fresh ideas.

I consider the standard workaround given ( typedef MyBase base; )
tedious, error prone, and very hard to maintain.

Basically, the advantages that I see to having a "base" keyword are:

1) as Hyman Rosen wrote,
 > MI is what makes the implementation *necessary*.
 > Right now, in order to call a base class method, I
 > must know in which base class that method is declared.

It is understood that if there is ambiguity, this would be a compile
error.


2) In an inheritance heiarchy, explicitly specifying the name of the
base makes refactoring / modification to the heiarchy error prone. If
I have class Base and several Derived and insert a class between them,
I must manually modify all of the derived classes in more than one
place. Having a "base" keyword makes this seamless.

3) possibly in a templated situation ( can't think of any off the top
of my head, but I know I have though of this problem when writing a
class template before. )

Eric Beyeler

---
[ comp.std.c++ is moderated.  To submit articles, try just posting with ]
[ your news-reader.  If that fails, use mailto:std-c++@ncar.ucar.edu    ]
[              --- Please see the FAQ before posting. ---               ]
[ FAQ: http://www.jamesd.demon.co.uk/csc/faq.html                       ]