From 2247638188808121229
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f78e5,49dc144769c6b88f
X-Google-Attributes: gidf78e5,public
From: David Bruce <dib@dera.gov.uk>
Subject: Empty objects (was Re: Are there any plans to make "properties" standard?)
Date: 1999/06/25
Message-ID: <37734C93.672DA531@dera.gov.uk>#1/1
X-Deja-AN: 493792437
X-Nntp-Posting-Host: signal.dera.gov.uk
Content-Transfer-Encoding: 7bit
Approved: stephen.clamage@sun.com (comp.std.c++)
References: <7jprhq$e8r@cocoa.brown.edu> <MPG.11cb8735d7f70732989b60@news.mindspring.com> <376278B4.C9EDDB26@acm.org>
X-Accept-Language: en-GB, en, en-US
Content-Type: text/plain; charset=us-ascii
Organization: DERA Malvern
Mime-Version: 1.0
Newsgroups: comp.std.c++
Originator: clamage@taumet


Pete Becker wrote (apropos Jerry Coffin's observation that properties can
naturally be encoded in C++ using objects):

> Yup. And if you do this through objects, then the containing class can
> end up with a half-dozen (perhaps, often many more) empty objects as
> members, inflating its size.

Right, so the real question for c.s.c++ is not ``how do we do properties''
but rather ``what changes would need to be made to C++ to allow this natural
use of objects to be implemented (space) efficiently'', this being not only
the root cause but also a more general problem.

I'm aware that the issue is that (member) objects are not permitted to have
the same address, so I guess I'm asking *why* that's so important, and what
an alternative C++ where it wasn't the case would look like.

For example, given that C++ has references, when do we really need to take
the address of (member) objects (as distinct from their pointer-to-member
`address')?  (Identity comparisons are perhaps the most obvious case, but
maybe if one could compare objects for identity directly -- e.g., a
non-overloadable operator=== ? -- rather than by comparing their addresses
this might be less significant.)  What else could go wrong if two (member)
objects did have the same address?


Sincerely,

    David Bruce
________________________________________________________________________
post: DERA Malvern, St Andrews Road, Malvern, WORCS WR14 3PS, ENGLAND
mailto:dib@dera.gov.uk ** phone: +44 1684 895112 ** fax: +44 1684 894389
[The views expressed above are entirely those of the writer and do not represent the views, policy or understanding of any other person or official body.]




[ comp.std.c++ is moderated.  To submit articles, try just posting with ]
[ your news-reader.  If that fails, use mailto:std-c++@ncar.ucar.edu    ]
[              --- Please see the FAQ before posting. ---               ]
[ FAQ: http://reality.sgi.com/austern_mti/std-c++/faq.html              ]




