The point of the POD is not only to make sure that the type is compatible with C - note that a type with an access specifier ( public , private , etc.) is by definition incompatible with C, because C doesn I have access specifiers. The main property of the POD type is that it can be memcpy'ed around.
Having more than one access specifier in a C ++ type allows the compiler to lay out the type in an unspecified way, and this has been true for some time (this is not new with C ++ 11):
From C ++ 03 9.2 / 12
Non-static data members of a (non-single) class declared without an intermediate access specifier are allocated so that subsequent members have higher addresses inside the class object. Distribution order Non-static data elements separated by an access specifier are not defined (11.1).
However, this does not make the type of non-POD - it can still be a POD, just not the one that can be portable in C.
source share