home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!charon.amdahl.com!pacbell.com!decwrl!hal.com!olivea!spool.mu.edu!sgiblab!munnari.oz.au!metro!extro.ucc.su.OZ.AU!maxtal
- From: maxtal@extro.ucc.su.OZ.AU (John MAX Skaller)
- Newsgroups: comp.lang.c++
- Subject: Re: operator = with inheritance
- Message-ID: <1993Jan26.211456.28955@ucc.su.OZ.AU>
- Date: 26 Jan 93 21:14:56 GMT
- References: <1993Jan20.221834.26489@virginia.edu> <1993Jan21.022943.12381@ucc.su.OZ.AU> <1993Jan21.162116.24219@murdoch.acc.Virginia.EDU>
- Sender: news@ucc.su.OZ.AU
- Organization: MAXTAL P/L C/- University Computing Centre, Sydney
- Lines: 31
- Nntp-Posting-Host: extro.ucc.su.oz.au
-
- In article <1993Jan21.162116.24219@murdoch.acc.Virginia.EDU> gs4t@virginia.edu (Gnanasekaran Swaminathan) writes:
- >maxtal@extro.ucc.su.OZ.AU (John MAX Skaller) writes:
- >: It wont cope with class C: public A though:
- >: this will still slice the A part of a C object onto the A part
- >: of a B object. What else COULD it do?
- >
- > A
- > / \
- > B C
- >
- >Since, B and C has only A part common, that is
- >the appropriate thing to do, isn't it?
-
- Well, who knows? But the technique makes assignments
-
- A->A
-
- special (they assign the complete object) but other not special,
- which may, or may not, be a good thing. That is, it 'solves'
- the slicing problem for a special (but very important) case.
-
- The generalisation does the 'best possible' assignment it can
- (e.g. in the case A derives B derives C derives D derives E ...
- then it 'reduces' the slicing to the minimum possible,
- although not preventing it.
-
- --
- ;----------------------------------------------------------------------
- JOHN (MAX) SKALLER, maxtal@extro.ucc.su.oz.au
- Maxtal Pty Ltd, 6 MacKay St ASHFIELD, NSW 2131, AUSTRALIA
- ;------ SCIENTIFIC AND ENGINEERING SOFTWARE ---ph: 2 799 8223 --------
-