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

  1. Path: sparky!uunet!gatech!rpi!masscomp!peora!tarpit!fang!att!dptg!ulysses!allegra!alice!ark
  2. From: ark@alice.att.com (Andrew Koenig)
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: Renew?
  5. Message-ID: <23322@alice.att.com>
  6. Date: 26 Jul 92 23:06:28 GMT
  7. References: <memo.542965@cix.compulink.co.uk>
  8. Reply-To: ark@alice.UUCP ()
  9. Organization: AT&T Bell Laboratories, Liberty Corner NJ
  10. Lines: 18
  11.  
  12. In article <memo.542965@cix.compulink.co.uk> vadim@cix.compulink.co.uk writes:
  13.  
  14. >   ObjWithRenew *p; 
  15. >   p = (ObjWithRenew *)realloc(old, newsize);
  16. >   p->renewed(s);  // We can do this because realloc copied
  17. >            // the vptr too
  18.  
  19. No such luck.  People are entitled to write classes whose objects,
  20. for example, store their addresses in other data structures.  In general,
  21. you cannot expect to be able to copy the bits that represent an
  22. arbitrary object from here to there without breaking things.
  23.  
  24. Moreover, implementations that use pointers rather than offsets to
  25. locate virtual base classes are guaranteed to break under such movement.
  26. That includes all cfront-based implementations.
  27. -- 
  28.                 --Andrew Koenig
  29.                   ark@europa.att.com
  30.