Why does C++ StandardLayout disallow mixed access specifiers?

101 Views Asked by At

I hear often this is for backward compatibility with C. But C does not have access specifiers, so how can they break compatibility?

And a related question, why do mixed access specifiers allow the compiler to change the order of the members of a struct in memory?

0

There are 0 best solutions below