Boost logo

Boost :

From: David Abrahams (dave_at_[hidden])
Date: 2004-01-07 08:37:23

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

> "Lars Gullik Bjønnes" <larsbj_at_[hidden]> wrote in message
>> "David B. Held" <dheld_at_[hidden]> writes:
>> >> Probably can't get any better on BCB.
>> >
>> | Actually, you probably can't get much better on any compiler, for
>> | reasons listed in one of the threads on SmartPtr, and mentioned
>> | in Andrei's & my Oct '03 CUJ article.
>> Gcc says size is 4, or are you talking of something differnt?
> GCC *might* be wrong to say that. ;) I believe there's currently a
> DR on the subject, but I might mistaken. To sum up, there is a way
> to read the standard that requires each base class to have a
> unique address, which would require them to have non-zero size.

I think you're completely wrong on this, Dave. There's no DR AFAIK.
The only thing required by the standard is that two subobjects of the
same type don't share the same address.

The only reason more compilers don't implement EBO for MI is that they
don't have the luxury of changing their ABI as GCC did when it made
the 2.x -> 3.x transition.

> EBO works because the base class can share an address with
> the derived class. But two non-virtual base classes might not
> be allowed to share an address.

Only if they have a common base or subobject.

> That said, I'm very happy that
> gcc gives sizeof(4) anyway, and I found that of the compilers I had
> to test, it was always the most aggressive in making things small.
> Dave
> ---
> Outgoing mail is certified Virus Free.
> Checked by AVG anti-virus system (
> Version: 6.0.556 / Virus Database: 348 - Release Date: 12/26/2003
> _______________________________________________
> Unsubscribe & other changes:

Dave Abrahams
Boost Consulting

Boost list run by bdawes at, gregod at, cpdaniel at, john at