[cxx-abi-dev] Nearly empty classes
Mark Mitchell
mark at codesourcery.com
Thu Oct 24 07:08:25 UTC 2002
--On Wednesday, October 23, 2002 11:51:27 PM -0700 Jim Dehnert
<dehnert at transmeta.com> wrote:
> Mark Mitchell wrote:
>>
>> I believe the correct fix is to to rephrase the first line of the
>> definition of nearly empty class as:
>>
>> A dynamic class that contains no data except its virtual pointer or
>> virtual bases. In particular, it:
>>
>> Any objections?
>
> That is, you mean to require that a nearly empty class has a virtual
> pointer? If so, you should say so more explicitly.
OK, we can tweak the wording.
> But my gut feeling is that it makes more sense to add the condition to
> the primary base choice, since that's what it comes from.
But there's no other use of "nearly empty" in the document; the whole
point of the concept of "nearly empty" is for this virtual base as
primary base idea. Besides, if you said your fridge was "nearly
empty" you'd mean you had a solitary jar of old mayonnaise in there,
not that you had nothing at all. It doesn't make sense to say
something is "nearly empty" if it is actually empty.
Of course, it's just a choice of where to put the words; it doesn't make
any difference in terms of what code gets generated by compilers...
--
Mark Mitchell mark at codesourcery.com
CodeSourcery, LLC http://www.codesourcery.com
More information about the cxx-abi-dev
mailing list