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

  1. Newsgroups: comp.std.c++
  2. Path: sparky!uunet!titan!lpi!pkt
  3. From: pkt@lpi.liant.com (Scott Turner)
  4. Subject: Re: pointer comparisons
  5. Message-ID: <1992Dec31.152700.21521@lpi.liant.com>
  6. Sender: pkt@lpi (Scott Turner)
  7. Organization: Liant Software Corporation
  8. References: <1992Dec27.050118.1628@lpi.liant.com> <1992Dec30.184614.5551@microsoft.com>
  9. Date: Thu, 31 Dec 1992 15:27:00 GMT
  10. Lines: 42
  11.  
  12. In article <1992Dec30.184614.5551@microsoft.com>, jimad@microsoft.com (Jim Adcock) writes:
  13. > In article <1992Dec27.050118.1628@lpi.liant.com> pkt@lpi.liant.com (Scott Turner) writes:
  14. > |The desired feature is:
  15. > |Two pointers to the same type, which point to distinct objects
  16. > |of that type, compare not equal.
  17. > Can you define your terms for us?
  18.  
  19. > I'm sure each of these things seems clear to you, yet they are not.
  20.  
  21. I'm talking about expressions with equality operators,
  22. i.e. 5.10 of the ARM.  By "two pointers to the same type" I mean
  23. to address just those cases in which both operands are pointer-type
  24. expressions, and in which the types of the expressions are
  25.     [const/volatile] pointer to [const/volatile] type A
  26. and
  27.     [const/volatile] pointer to [const/volatile] type B
  28. where A and B are the "same type".  (I spell this out to indicate that
  29. this is concerned with the static expression type, not the type of some
  30. object, possibly enclosing the one pointed to.)
  31.  
  32. "Same type" is a term used repeatedly in the ARM.  It has its limitations,
  33. but is adequate for my purpose.
  34.  
  35. "Point to distinct objects" would imply two things:
  36. (1) Each operand points to one object (not a function, and is not null or
  37.     invalid).
  38. (2) The objects are not identicial.  I hope to say more about this in 
  39.     another article.
  40.  
  41. The case I'm concerned with is limited to "objects of that type", i.e.
  42. each operand points to a properly constructed object of type A (which may
  43. be a subobject of an enclosing object constructed with a different type).
  44.  
  45. "Compare not equal" is self-evident; the C standard uses the same kind
  46. of wording.  It means that the result of the operator != is 1 (TRUE) and
  47. the result of the operator == is 0 (FALSE).
  48. --
  49. Prescott K. Turner, Jr.
  50. Liant Software Corp. (developers of LPI languages)
  51. 959 Concord St., Framingham, MA 01701 USA    (508) 872-8700
  52. UUCP: uunet!lpi!pkt                          Internet: pkt@lpi.liant.com
  53.