In C++, if I declare a class/struct as thus:
struct Data
{
int member0;
int member1;
};
In most compilers, member0
appears earlier in the object representation than member1
.
Does the standard mandate this behaviour, or is a compiler theoretically allowed to put member1
before member0
in the object representation?
What does the standard have to say about this, and where does it say it?
(I am interested in all standard versions if the mandated behaviour has changed at any point.)