Boost logo

Boost :

From: David Abrahams (dave_at_[hidden])
Date: 2004-01-07 15:30:36


"David B. Held" <dheld_at_[hidden]> writes:

> "David Abrahams" <dave_at_[hidden]> wrote in message
> news:ur7ybg9rg.fsf_at_boost-consulting.com...
>>
>> I think you're completely wrong on this, Dave. There's no DR
>> AFAIK.
>
> Ok, I briefly looked, and there doesn't seem to be one.
>
>> The only thing required by the standard is that two subobjects of
>> the same type don't share the same address.
>
>> [...]
>> > But two non-virtual base classes might not be allowed to share
>> > an address.
>>
>> Only if they have a common base or subobject.
>
> So how do you read 10.1/4?
>
> "A base class specifier that does not contain the keyword
> virtual, specifies a nonvirtual base class. A base class
> specifier that contains the keyword virtual, specifies a
> virtual base class. For each distinct occurrence of a nonvirtual
> base class in the class lattice of the most derived class, the
> most derived object (1.8) shall contain a corresponding
> distinct base class subobject of that type."

"occurrence of a nonvirtual base class" means "occurrence of a
particular nonvirtual base class".

When class A and class B both appear as bases, they are not
"occurrences" of any common thing. They're just separate things.

> Even though the examples in that section seem to referring to
> the case of a single type appearing multiple times in an
> inheritance lattice, the language certainly does not restrict the
> definition to that case.

Yes, it certainly does.

> So it seems entirely reasonable to me
> that the language would apply even without consideration of
> common base classes/subobjects. Also, it seems that Mr.
> Vandevoorde agrees with this assessment:
>
> http://www.vandevoorde.com/Daveed/News/Archives/000007.html

AFAICT that discusses something almost completely unrelated.

> If it was the intent of the committee to only limit the distinct
> requirement to cases of common base classes, it would be
> nice if they added a note to 10.1/4 saying so.

So submit a DR.

-- 
Dave Abrahams
Boost Consulting
www.boost-consulting.com

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk