home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / std / cplus / 1970 < prev    next >
Encoding:
Text File  |  1993-01-04  |  2.8 KB  |  65 lines

  1. Newsgroups: comp.std.c++
  2. Path: sparky!uunet!microsoft!hexnut!jimad
  3. From: jimad@microsoft.com (Jim Adcock)
  4. Subject: Re: pointer comparisons
  5. Message-ID: <1993Jan05.003819.12515@microsoft.com>
  6. Date: 05 Jan 93 00:38:19 GMT
  7. Organization: Microsoft Corporation
  8. References: <1992Dec27.050118.1628@lpi.liant.com> <1992Dec30.184614.5551@microsoft.com> <1992Dec31.170223.21637@lpi.liant.com>
  9. Lines: 54
  10.  
  11. In article <1992Dec31.170223.21637@lpi.liant.com> pkt@lpi.liant.com (Scott Turner) writes:
  12. |In article <1992Dec30.184614.5551@microsoft.com> (Jim Adcock) writes:
  13. |> Can you define your terms for us?
  14. |
  15. |> "distinct objects" means what?
  16. |It means the objects are not identical.  
  17.  
  18. Which only leaves the issue of object identity.
  19.  
  20. |I was going to say that the standard for C++ needs to spell out what it
  21. |means for object to be identical in a better way than just by
  22. |     1. An object is a region of storage.
  23. |     2. A definition or a new expression reserves the storage
  24. |        needed by the object.
  25. |These two rules leave things much more loose than necessary when objects
  26. |require no storage.  But note that section 1.3 of the working paper 
  27.  
  28. Lots of other things remain unclear.  If a definition or a new expressions
  29. reserves the storage needed by an object, when and when not can other
  30. objects use this storage? [this is a trick question ;-]
  31.  
  32. |    The constructs in a C++ program create, refer to, access, and
  33. |    manipulate objects in memory.  Each object (except bit-fields)
  34. |    occupies one or more contiguous bytes.
  35.  
  36. Can other objects occupy those bytes?
  37.  
  38. |I missed this a while back when enumerating the features of the ARM and
  39. |working paper which supported
  40. |> The desired feature is:
  41. |>     Two pointers to the same type, which point to distinct objects
  42. |>     of that type, compare not equal.
  43. |This excerpt from 1.3 gives the general rule I was seeking, because
  44. |objects can be distinguished by the storage reserved for them.
  45.  
  46. That depends on what exactly is meant by "two pointers to the same type,
  47. which point to distinct objects of that type"
  48.  
  49. At the very least "same type" and "distinct objects" remain poorly defined
  50. in this discussion.
  51.  
  52. |    Does it govern base class subobjects?  As I understand it,
  53. |    base class subobjects are objects, and hence are covered.
  54.  
  55. As I understand it, base class subobjects are NOT objects, because
  56. in the case of virtual bases this would violate the contiguous-bytes
  57. rule.  Further it would violate the overlapping objects rule.  Also,
  58. it would imply that deriving some class from some base class can cause
  59. a change in behavior of an "object" of that base class, and such flies
  60. in the face of reason [IMHO].  So I believe "base clas subobjects" are
  61. simply distinct views on one object.  One object can have multiple
  62. identities then, depending on how it is viewed -- as demonstrated in
  63. my multiple-base example.
  64.  
  65.