ssimmons@convex.com (Steve Simmons) (02/26/91)
I've run across the following problem for defining an interface
for a base class. Essentially, I need to create a function
with the following behavior....
int BaseClass::function(BaseClass** parm);
The problem is that there in an intention to derive other classes
from this base class. Therefore, if I were to make the following
declaration...
class DerivedClass : public BaseClass {}
DerivedClass *instance;
I would need to make the following cast in the call to the
inherited member...
instance->function((BaseClass**) &instance);
In fact, I cannot even use this base class as part of
a multi-inherited chain... Is there a decent work around
so that this cast is not necessary??? Is it a weakness in
the language??? I've noticed that the NIH uses a castdown
mechanism and is this the best that we can do???
Thank you.
Steve Simmons