Don wrote:
Stewart Gordon wrote:
<snip>
That's only because you want to be able to attach alignments to
individual members of a union. And I still don't know why.
I'm not sure why you think unions are so different to structs. They are
identical in most respects -- including requirements for alignment of
members.
I still don't know what you mean.
If you want a union to have a certain alignment relative to a struct
in which it's contained, in what cases is it not sufficient to put the
align attribute on the union's instance in the struct?
In cases where you don't know what the containing struct is. The union
may just be a type returned from a template, for example.
If you don't know what the containing struct is, you probably also don't
know what member alignment that struct requires. The person who creates
the struct, OTOH, does know. So why are you trying to do that person's job?
Stewart.