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

  1. Path: sparky!uunet!wupost!usc!enterpoop.mit.edu!eru.mt.luth.se!lunic!sunic!news.lth.se!dag
  2. From: dag@bellman.control.lth.se (Dag Bruck)
  3. Newsgroups: comp.std.c++
  4. Subject: Re: Zero-length structures and pointer comparisons
  5. Message-ID: <1992Dec12.215255.29154@lth.se>
  6. Date: 12 Dec 92 21:52:55 GMT
  7. References: <1992Dec8.103218.27689@lth.se> <9234423.15066@mulga.cs.mu.OZ.AU> <1992Dec9.133956.29659@lth.se> <1992Dec12.155417.2628@ucc.su.OZ.AU>
  8. Sender: news@lth.se
  9. Organization: Department of Automatic Control, Lund, Sweden
  10. Lines: 18
  11.  
  12. In <comp.std.c++> maxtal@extro.ucc.su.OZ.AU (John MAX Skaller) writes:
  13. >In article <...> dag@seldon.control.lth.se (Dag Bruck) writes:
  14. >>
  15. >>Suggested semantics: for any pointers p and q:
  16. >>
  17. >>    p == q   <=>   ptrcmp(p,q) == 0
  18. >
  19. >    Are you SURE you need this? Why should == and ptrcmp
  20. >be in any way related?
  21.  
  22. Because it would be very counter-intuitive, hence error-prone, if that
  23. equality did not hold.
  24.  
  25. I also support the additional rule suggested by Jerry Schwarz:
  26.  
  27.     if (p < q) is defined:
  28.  
  29.     p < q   <=>   ptrcmp(p,q) < 0
  30.