home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / std / cplus / 1975 < prev    next >
Encoding:
Text File  |  1993-01-05  |  2.9 KB  |  74 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: <1993Jan5.203237.28304@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> <1992Dec31.170223.21637@lpi.liant.com> <1993Jan05.003819.12515@microsoft.com>
  9. Date: Tue, 5 Jan 1993 20:32:37 GMT
  10. Lines: 62
  11.  
  12. In article <1993Jan05.003819.12515@microsoft.com>, jimad@microsoft.com (Jim Adcock) writes:
  13. > In article <1992Dec31.170223.21637@lpi.liant.com> pkt@lpi.liant.com (Scott Turner) writes:
  14. > |In article <1992Dec30.184614.5551@microsoft.com> (Jim Adcock) writes:
  15. > |> Can you define your terms for us?
  16. > |
  17. > |> "distinct objects" means what?
  18. > |It means the objects are not identical.  
  19. > Which only leaves the issue of object identity.
  20.  
  21. Which is where I wish to leave the issue, willing to trust for the present
  22. that objects which I wish distinct will be distinct.  This trust rests on
  23.  
  24.       1. The status of distinct objects as objects.
  25.  
  26.       2. The guarantee of 1.3 that an object occupies at least 1 byte
  27.          of storage.
  28.  
  29.       3. The implementation's duty to reserve storage for objects.
  30.  
  31. If anyone can think of an example in which I am likely to be diappointed
  32. and end up surprised with indistinct objects, I'd be grateful to see it.  
  33. (Implementations which don't do their duty aren't necessarily a surprise.)
  34.  
  35. > Lots of other things remain unclear.  If a definition or a new expressions
  36. > reserves the storage needed by an object, when and when not can other
  37. > objects use this storage? [this is a trick question ;-]
  38.  
  39. I was responding to clarify a possible feature of pointer comparison.
  40. To clarify everything is beyond me.
  41.  
  42. > |    The constructs in a C++ program create, refer to, access, and
  43. > |    manipulate objects in memory.  Each object (except bit-fields)
  44. > |    occupies one or more contiguous bytes.
  45. > Can other objects occupy those bytes?
  46.  
  47. Yes.  An _other_ object is distinct, not identical to the object with which
  48. it shares storage.  For example, given
  49.     int x[9];
  50. then the bytes occupied by the objects x and x[2] overlap.
  51.  
  52. > |    Does it govern base class subobjects?  As I understand it,
  53. > |    base class subobjects are objects, and hence are covered.
  54. > As I understand it, base class subobjects are NOT objects, because [...]
  55. > Further it would violate the overlapping objects rule.  
  56.  
  57. What rule?
  58.  
  59. > Also, it would imply that deriving some class from some base class can cause
  60. > a change in behavior of an "object" of that base class, and such flies
  61. > in the face of reason [IMHO].  
  62.  
  63. If some class declares a virtual function, it's asking to be changeable.
  64. --
  65. Prescott K. Turner, Jr.
  66. Liant Software Corp. (developers of LPI languages)
  67. 959 Concord St., Framingham, MA 01701 USA    (508) 872-8700
  68. UUCP: uunet!lpi!pkt                          Internet: pkt@lpi.liant.com
  69.  
  70.  
  71.