home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / comp / lang / cplus / 19978 < prev    next >
Encoding:
Internet Message Format  |  1993-01-28  |  1.7 KB

  1. 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
  2. From: maxtal@extro.ucc.su.OZ.AU (John MAX Skaller)
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: operator = with inheritance
  5. Message-ID: <1993Jan26.211456.28955@ucc.su.OZ.AU>
  6. Date: 26 Jan 93 21:14:56 GMT
  7. References: <1993Jan20.221834.26489@virginia.edu> <1993Jan21.022943.12381@ucc.su.OZ.AU> <1993Jan21.162116.24219@murdoch.acc.Virginia.EDU>
  8. Sender: news@ucc.su.OZ.AU
  9. Organization: MAXTAL P/L C/- University Computing Centre, Sydney
  10. Lines: 31
  11. Nntp-Posting-Host: extro.ucc.su.oz.au
  12.  
  13. In article <1993Jan21.162116.24219@murdoch.acc.Virginia.EDU> gs4t@virginia.edu (Gnanasekaran Swaminathan) writes:
  14. >maxtal@extro.ucc.su.OZ.AU (John MAX Skaller) writes:
  15. >:     It wont cope with class C: public A though:
  16. >: this will still slice the A part of a C object onto the A part
  17. >: of a B object. What else COULD it do?
  18. >
  19. >    A
  20. >       / \
  21. >      B   C
  22. >
  23. >Since, B and C has only A part common, that is
  24. >the appropriate thing to do, isn't it?
  25.  
  26.     Well, who knows? But the technique makes assignments
  27.  
  28.     A->A
  29.  
  30. special (they assign the complete object) but other not special,
  31. which may, or may not, be a good thing. That is, it 'solves'
  32. the slicing problem for a special (but very important) case.
  33.  
  34. The generalisation does the 'best possible' assignment it can
  35. (e.g. in the case A derives B derives C derives D derives E ...
  36. then it 'reduces' the slicing to the minimum possible,
  37. although not preventing it.
  38.  
  39. -- 
  40. ;----------------------------------------------------------------------
  41.         JOHN (MAX) SKALLER,         maxtal@extro.ucc.su.oz.au
  42.     Maxtal Pty Ltd, 6 MacKay St ASHFIELD, NSW 2131, AUSTRALIA
  43. ;------ SCIENTIFIC AND ENGINEERING SOFTWARE ---ph:  2 799 8223 --------
  44.