home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / comp / lang / cplus / 11840 < prev    next >
Encoding:
Internet Message Format  |  1992-07-30  |  1.8 KB

  1. Path: sparky!uunet!dtix!darwin.sura.net!convex!constellation!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: Renew?
  5. Message-ID: <1992Jul30.165447.17724@ucc.su.OZ.AU>
  6. Date: 30 Jul 92 16:54:47 GMT
  7. References: <memo.547224@cix.compulink.co.uk> <23347@alice.att.com>
  8. Sender: news@ucc.su.OZ.AU
  9. Organization: MAXTAL P/L C/- University Computing Centre, Sydney
  10. Lines: 29
  11. Nntp-Posting-Host: extro.ucc.su.oz.au
  12.  
  13. In article <23347@alice.att.com> ark@alice.UUCP () writes:
  14. >In article <memo.547224@cix.compulink.co.uk> vadim@cix.compulink.co.uk writes:
  15. >
  16. >> I  agree, that a pointer to original object stored somewhere
  17. >> else creates a dangerous situation, but this is still true even if the
  18. >> 'operator renew' was built-in in the language. Renew and realloc should
  19. >> be always used with caution.  
  20. >
  21. >If renew guarantees to the user that the copy constructor and
  22. >destructor will be called for each object moved, that greatly
  23. >ameliorates the situation.  It is then sufficient for the user to
  24. >get those two functions right, or make them private (which would
  25. >prohibit renew on objects of that class).
  26.  
  27.     Surely it is sensible that if renew is declared by the user,
  28. that version of renew is used. Otherwise, renew is generated from the
  29. copy constructor and destructor declared by the user.
  30.  
  31.     If the user declares neither the copy constructor or destructor,
  32. then the generated renew need not correspond to physical
  33. calls to the compiler generated copy constructor and destructor,
  34. since in this case all three are generated by the compiler.
  35.  
  36.  
  37. -- 
  38. ;----------------------------------------------------------------------
  39.         JOHN (MAX) SKALLER,         maxtal@extro.ucc.su.oz.au
  40.     Maxtal Pty Ltd, 6 MacKay St ASHFIELD, NSW 2131, AUSTRALIA
  41. ;--------------- SCIENTIFIC AND ENGINEERING SOFTWARE ------------------
  42.