Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!hellgate.utah.edu!caen!zaphod.mps.ohio-state.edu!uwm.edu!linac!convex!ssimmons From: ssimmons@convex.com (Steve Simmons) Newsgroups: comp.lang.c++ Subject: Passing a doubly dereferenced pointer of a base class Message-ID: Date: 26 Feb 91 14:19:40 GMT Sender: news@convex.com (news access account) Organization: Convex Computer Corporation, Richardson, Tx. Lines: 32 Nntp-Posting-Host: pixel.convex.com 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