[quote name='Ectara' timestamp='1355936352' post='5012489']
I've seen this solution, before, and despite it looking fancy, it ignores what was also stated above "Implementation alignment requirements might cause two adjacent members not to be allocated immediately after each other; so might requirements for space for managing virtual functions (10.3) and virtual base classes (10.1)." It may be implementation defined to have 4 byte int members aligned to 8 byte boundaries. Such a machine that requires it would be inefficient, but that makes no difference in the fact that the standard allows for an implementation that would cause this example to break. Thus, I've avoided it.
What's harder to imagine is an architecture that would require alignment of members of the same type different from the alignment required of elements in an array. That's why I said that they will both work in practice.
If you worry that your compiler might put an infinite loop before returning from main because the standard allows it (at least that's my reading of the section on "observable behavior"), then you may also worry about a compiler putting padding between members of the same basic type. Otherwise, not really something to stress about.
[/quote]
I agree with you, you won't likely encounter this behavior. I'm just saying, if I have a choice between standards compliance and not standards compliance, and they both produce the same results for roughly the same cost, then I have no reason to be non-compliant.