home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / comp / lang / cplus / 18366 < prev    next >
Encoding:
Text File  |  1992-12-23  |  1.8 KB  |  50 lines

  1. Newsgroups: comp.lang.c++
  2. Path: sparky!uunet!munnari.oz.au!bunyip.cc.uq.oz.au!kirk!ptcburp!michi
  3. From: michi@ptcburp.ptcbu.oz.au (Michael Henning)
  4. Subject: Re: Is it possible to use 'delete this' ?
  5. Message-ID: <1992Dec23.235809.20778@ptcburp.ptcbu.oz.au>
  6. Organization: Pyramid Technology Corporation
  7. References: <Dy93VB2w165w@bwhwob.escape.de> <rmartin.725129268@thor> <BzqE5s.6Lr@comp.vuw.ac.nz>
  8. Date: Wed, 23 Dec 1992 23:58:09 GMT
  9. Lines: 39
  10.  
  11. robertd@kauri.vuw.ac.nz (Robert Davies) writes:
  12.  
  13. >rmartin@thor.Rational.COM (Bob Martin) writes:
  14. >>bernd@bwhwob.escape.de (Bernd Wiegmann) writes:
  15. >>
  16. >>>Hi,
  17. >>
  18. >>>Is it possible to use 'delete this' as the last statement in a
  19. >>>method of a class ?
  20. >>
  21. >>In general, "delete this" is a bad idea.
  22. >> .........
  23.  
  24. >This is the standard argument - but I suspect it is not necessarily the 
  25. >correct one.
  26.  
  27. >I agree that "delete this" could be very confusing in a function likely to
  28. >be used by others (or oneself, sometime in the future), but for a function
  29. >that is only for internal use by one's package, probably declared private 
  30. >and properly documented, there doesn't seem to be a problem.
  31.  
  32. >The danger with the statements that "delete this" is not a good idea is 
  33. >that the compiler writers or standards committee will listen and a very
  34. >useful construct (in some situations) will be lost.
  35.  
  36.  
  37. There is already precedence for delete(this), in the C++ task library.
  38. Since Bjarne was involved in writing the code for this one, I would
  39. expect the standard to sanction it :-)
  40.  
  41. The reference manual, section 5.3.4, says nothing to prohibit it.
  42.  
  43.                                 Michi.
  44.  
  45. -- 
  46.       -m------- Michael Henning                 +61 75 950255
  47.     ---mmm----- Pyramid Technology              +61 75 722475 FAX
  48.   -----mmmmm--- Research Park, Bond University  michi@ptcburp.ptcbu.oz.au
  49. -------mmmmmmm- Gold Coast, Q 4229, AUSTRALIA   uunet!munnari!ptcburp.oz!michi
  50.