title: Class layout in C++: Why are members sometimes ordered?
body: <p>The C++ standard dictates that member variables inside a single access section must be layed out in memory in the same order they were declared in.  At the same time, compilers are free to choose the mutual ordering of the access sections themselves.  This freedom makes it impossible in theory to link binaries created by different compilers.  So what are the remaining reasons for the strict in-section ordering?  And does the <s>upcoming C++09</s> new C++11 standard provide a way to fully determine object layouts "by hand"?</p>