Suppose I have a POD type like this:
struct A {
char a;
int b;
};
On my system, sizeof(A) == 8
, even though size
given that you asked about a POD type ( hence including unions ) it's worth mentioning that according to [class.copy]
The implicitly-defined copy/move constructor for a union X copies the object representation (6.9) of X
that for trivially copyable types should include padding bits as well. So, it could be just a matter of replacing A with
union A{ struct {
char a;
int b;
}; };
(actually, the above uses a non standard anonymous struct, but you get the point ... )