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

  1. Path: sparky!uunet!mcsun!sunic!hagbard!loglule!jbn
  2. From: jbn@lulea.trab.se (Johan Bengtsson)
  3. Newsgroups: comp.std.c++
  4. Subject: Re: Zero-length structures and pointer comparisons
  5. Message-ID: <5384@holden.lulea.trab.se>
  6. Date: 15 Dec 92 18:59:55 GMT
  7. References: <1992Dec14.225659.24225@microsoft.com>
  8. Organization: Telia Research AB, Aurorum 6, 951 75 Lulea, Sweden
  9. Lines: 26
  10. X-Newsreader: TIN [version 1.1 + PL8]
  11.  
  12. Jim Adcock (jimad@microsoft.com) wrote:
  13. : In article <1992Dec12.154918.2220@ucc.su.OZ.AU> maxtal@extro.ucc.su.OZ.AU (John MAX Skaller) writes:
  14. : |which cannot break existing implementations but provides a  total
  15. : |order by way of a library function? If so, can we put this to
  16. : |the library WG?
  17.  
  18. : In any case, "ptrcmp" would be a misnomer, because what is being compared
  19. : is *not* pointers, but rather the underlying *assumed* implementation of 
  20. : pointers using machine addresses.  The correct name might be something like 
  21. : "addrcmp" then, so as to not further confuse programmers on the difference
  22. : between language and implementation.
  23.  
  24. No, this is not right.  You can require that a total ordering of all
  25. pointers exist, without assuming anything about their representation.
  26.  
  27. The abstract ordering property will probably be implemented using
  28. machine addresses if pointers are implemented that way, but it is not
  29. a given that total pointer ordering needs machine addresses.
  30.  
  31. Therefore, "ptrcmp" is a much better name than "addrcmp".
  32.  
  33. -- 
  34. --------------------------------------------------------------------------
  35. | Johan Bengtsson, Telia Research AB, Aurorum 6, S-951 75 Lulea, Sweden  |
  36. | Johan.Bengtsson@lulea.trab.se; Voice:(+46)92075471; Fax:(+46)92075490  |
  37. --------------------------------------------------------------------------
  38.