home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c++
- From: nikki@trmphrst.demon.co.uk (Nikki Locke)
- Path: sparky!uunet!pipex!demon!trmphrst.demon.co.uk!nikki
- Subject: Re: Virtual base classes
- Reply-To: nikki@trmphrst.demon.co.uk
- Distribution: world
- X-Mailer: cppnews $Revision: 1.30 $
- Organization: Trumphurst Ltd.
- Lines: 23
- Date: Tue, 15 Dec 1992 20:11:32 +0000
- Message-ID: <724475492snx@trmphrst.demon.co.uk>
- Sender: usenet@demon.co.uk
-
- In article <445@genie.UUCP> roger@genie.UUCP (Roger H. Scott) writes:
- > In article <1992Dec8.192759.24081@cs.brown.edu> sdm@cs.brown.edu (Scott Meyers) writes:
- > >In article <rmartin.723768537@thor> rmartin@thor.Rational.COM (Bob Martin) writes:
- > >| ... There is nothing that can be done with private inheritance that cannot
- > >| be done, just as simply, with containment.
- > >
- > >Except for redefining virtual functions and accessing protected members.
- >
- > If Kludge is a non-public subclass [derived class] of WellFormed then there
- > isn't much point in talking about Kludge redefining WellFormed's virtual
- > functions since you can't use a Kludge in a place where a WellFormed is
- > expected (i.e., who would ever have hold of a Kludge and send it one of
- > WellFormed'd messages [call one of WellFormed'd virtual functions], other than
- > a member function of Kludge?).
-
- Imagine that WellFormed's constructor adds all WellFormeds to some
- Collection of WellFormeds. Notice that all Kludges will also be added to
- this collection. Now imagine some calling some virtual function for all
- WellFormeds in the Collection.
-
- --
- Nikki Locke,Trumphurst Ltd.(PC and Unix consultancy) nikki@trmphrst.demon.co.uk
- trmphrst.demon.co.uk is NOT affiliated with ANY other sites at demon.co.uk.
-