home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #30 / NN_1992_30.iso / spool / comp / lang / cplus / 18214 < prev    next >
Encoding:
Internet Message Format  |  1992-12-21  |  1.2 KB

  1. Path: sparky!uunet!autodesk!larsn
  2. From: larsn@Autodesk.COM (Lars Nyman)
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: What is this CFRONT 3.0 warning message trying to tell me?
  5. Message-ID: <18185@autodesk.COM>
  6. Date: 18 Dec 92 21:21:03 GMT
  7. References: <1992Dec17.184841.4563@cadkey.com>
  8. Organization: Autodesk Inc., Sausalito CA, USA
  9. Lines: 26
  10.  
  11. erics@cadkey.com (Eric Smith) writes:
  12. | In article <BzBzL2.5rx@apollo.hp.com> vinoski@ch.apollo.hp.com (Stephen Vinoski) writes:
  13. | |    Thing &
  14. | |    Thing::operator=(
  15. | |        const Thing &rhs    // note the addition of const here
  16. | |    )
  17. | |    {
  18. | |        if (this != &rhs) {
  19. | |        if (str != 0) {
  20. | |            free(str);
  21. | |        }
  22. | |        s = strdup(rhs.str);
  23. | |        }
  24. | |        return *this;
  25. | |    }
  26. | My reading of the ARM (section 5.9) says that this comparison is
  27. | undefined (or rather implementation dependent).  ANSI C (actually, I'm
  28. | looking in the ISO document, I'm not sure if the section numbers are
  29. | the same) has similiar language in 6.3.8 and 6.3.9.
  30.  
  31. I reach the same conclusion reading ARM...
  32.  
  33. ... that this commonly suggested convention of avoiding problems w/ 
  34. assignment to "the same object" is implementation dependent (and 
  35. thus rather useless).
  36.  
  37.