g++ and aliasing bools
Joe Buck
jbuck@synopsys.COM
Mon Jan 28 18:50:00 GMT 2002
> > The basic argument is this: I am allowed to implement C++ in a way that
> > zero-sized classes don't exist (they always come out as at least one
> > byte). For such implementations I can clearly use the C rules, as there
> > is an equivalent C program. If I then replace the inefficient
>
> [Implicitly, we're still in the simple_enough case here, i.e., no virtuals,
> etc. Perhaps the argument applies more generally, but we don't know yet.]
> OK, you've convinced me to extend simple_enough to the cases with
> zero-sized thingies, so long as the other conditions still hold.
We can handle inheritance as well if the zero-sized object is OK, since
the C translation is to make the base class look like a member of the
derived class. This will allow us to do better on most STL iterators;
many are derived classes but they have no virtual functions.
More information about the Gcc
mailing list