why would C++ reorder members of a class with different access control?

Viewed 53

According to the C++ standard: The order of allocation of non-static data members with different access control is unspecified.

and using operator offsetof do produce a warning under gcc when I have data members with different access control.

out of curiosity: why would a compiler do that ?

0 Answers
Related