home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / comp / std / cplus / 1878 < prev    next >
Encoding:
Text File  |  1992-12-21  |  1.3 KB  |  32 lines

  1. Newsgroups: comp.std.c++
  2. Path: sparky!uunet!munnari.oz.au!cs.mu.OZ.AU!munta.cs.mu.OZ.AU!fjh
  3. From: fjh@munta.cs.mu.OZ.AU (Fergus James HENDERSON)
  4. Subject: Re: Pointer comparisons
  5. Message-ID: <9235623.27053@mulga.cs.mu.OZ.AU>
  6. Sender: news@cs.mu.OZ.AU
  7. Organization: Computer Science, University of Melbourne, Australia
  8. References: <BzCG7K.2sG@frumious.uucp> <1992Dec16.202711.22367@bcrka451.bnr.ca> <BzDs2x.wA@frumious.uucp> <1992Dec17.151642.9954@bcrka451.bnr.ca>
  9. Date: Mon, 21 Dec 1992 12:50:09 GMT
  10. Lines: 20
  11.  
  12. sjm@bcrki65.bnr.ca (Stuart MacMartin) writes:
  13.  
  14. >In article <BzDs2x.wA@frumious.uucp> uunet.ca!frumious!pat writes:
  15. >>
  16. >>   Two pointers to the same object compare equal.  If two pointers
  17. >
  18. >...but nowhere do I see a statement that (p == q) ==> p and q point
  19. >to the same object, even if p and q are the same type.
  20.  
  21. This is apparently an oversight, an unintend omission.
  22. The ANSI C standard includes such a guarantee, so I am told,
  23. so C compatability requires that this hold at least for C++ objects
  24. that are also C objects. (Though it needn't apply for empty
  25. structs/classes, for example, since C doesn't allow empty structs.)
  26.  
  27. -- 
  28. Fergus Henderson             fjh@munta.cs.mu.OZ.AU      
  29. This .signature virus is a self-referential statement that is true - but 
  30. you will only be able to consistently believe it if you copy it to your own
  31. .signature file!
  32.