A piece of code is worth a thousands words.
#include <iostream>
#include <type_traits>
using namespace std;
struct A
{
int a;
};
struct B : A
{
int b;
};
int main()
{
cout << is_standard_layout<B>::value << endl; // output false! WHY?
return 0;
}
B b; cout << ( reinterpret_cast<int*> ( &b ) == ( &b.b ) ) << endl;
outputs false. – Valdemar