home *** CD-ROM | disk | FTP | other *** search
- Xref: sparky comp.object:2949 comp.lang.c++:11238 comp.std.c++:898
- Newsgroups: comp.object,comp.lang.c++,comp.std.c++
- Path: sparky!uunet!munnari.oz.au!metro!extro.ucc.su.OZ.AU!maxtal
- From: maxtal@extro.ucc.su.OZ.AU (John MAX Skaller)
- Subject: Re: Re^2: run-time type checking (was: Re: Covariant Types in Derived Classes)
- Message-ID: <1992Jul21.153405.23436@ucc.su.OZ.AU>
- Sender: news@ucc.su.OZ.AU
- Nntp-Posting-Host: extro.ucc.su.oz.au
- Organization: MAXTAL P/L C/- University Computing Centre, Sydney
- References: <1992Jul17.231700.17298@cadsun.corp.mot.com> <694@data.rain.com> <14feqsINNt9d@early-bird.think.com>
- Date: Tue, 21 Jul 1992 15:34:05 GMT
- Lines: 35
-
- In article <14feqsINNt9d@early-bird.think.com> barmar@think.com (Barry Margolin) writes:
- >In article <694@data.rain.com> kend@data.rain.com (Ken Dickey) writes:
- >>shang@corp.mot.com (David (Lujun) Shang) writes:
- >>>Then, once you put an object into a heterogeneous collection, the
- >>> object will lose its specific characteristics forever.
- >>An object cannot be a member of more than 1 set ??? 8^)
- >
- >Shang didn't really describe it well. The collection is presumably a set
- >of pointers or references, and it's those pointers/references that lose
- >their more specific characteristics; static type checking limits you to
- >treating them as objects of the class defined by the collection. The
- >original objects to which they refer still retain all their
- >characteristics, though. In particular, virtual function calls will use
- >the overriding definitions in derived classes. But members that are only
- >declared and defined in derived classes cannot be accessed through the
- >collection.
- >
- >If an object is referenced by more than one set, each set will define which
- >aspects of the object can be accessed.
-
- A mechanism facilitated by multiply inheriting from various
- abstract bases: one for each set you want the object to be in.
-
- >--
- >Barry Margolin
- >System Manager, Thinking Machines Corp.
- >
- >barmar@think.com {uunet,harvard}!think!barmar
-
-
- --
- ;----------------------------------------------------------------------
- JOHN (MAX) SKALLER, maxtal@extro.ucc.su.oz.au
- Maxtal Pty Ltd, 6 MacKay St ASHFIELD, NSW 2131, AUSTRALIA
- ;--------------- SCIENTIFIC AND ENGINEERING SOFTWARE ------------------
-