Path: utzoo!attcan!uunet!zaphod.mps.ohio-state.edu!usc!isi.edu!gremlin!wind.nrtc.northrop.com!kkenny From: kkenny@wind.nrtc.northrop.com (Kevin B. Kenny KE9TV) Newsgroups: comp.lang.c++ Subject: Delegation through a pointer Message-ID: <11578@gremlin.nrtc.northrop.com> Date: 24 Oct 90 20:01:53 GMT Sender: news@gremlin.nrtc.northrop.com Reply-To: ke9tv@nrtc.northrop.com (Kevin B. Kenny KE9TV) Organization: Northrop Research & Technology Center, Palos Verdes, CA Lines: 32 In Bjarne Stroustrup's paper, ``Multiple Inheritance for C++,'' Stroustrup discusses an extension of the inheritance mechanism that allows a class to inherit froman object identified by pointer: i.e., ------------------------------------------------------------------------ class B { int b; void f (); }; class C : public *p { private: B* p; public: C () : p (new B) {}; C (B* q) : p (q) {}; } void f (C* q) { q -> f (); // that is, q -> p -> f (); } ------------------------------------------------------------------------ This extension never made it into the language. I'm curious what its status is: were there insuperable problems with it? What other way is provided for the designer of a class B to specify that B wants to inherit from A *or from any of A's derived classes*? Kevin Kenny KE9TV Northrop Research & Technology Center Opinions expressed in this article are those of the author, and not official positions of Northrop Corporation or any of its subsidiaries.