Structure alignment changes when a constructor or destructor is added

Marc Glisse marc.glisse@inria.fr
Tue Dec 6 23:59:00 GMT 2011


On Wed, 7 Dec 2011, Marc Glisse wrote:

> And for std::tuple, this implies that:
> struct A { long a; char b; };

Argh, pasto... It was:
struct A { long a; char b; A(double); };

> sizeof(std::tuple<A,char>)==24
> sizeof(std::tuple<char,A>)==24
> because std::tuple has A as a member. If it had A as a base class, one of 
> those would be 16.
>
> The ABI is fun :-)

-- 
Marc Glisse



More information about the Gcc-help mailing list