I ran the below with g++ -std=c++0x pod_test.cpp
on g++ 4.6.2 (mingw). I get an error on A4. Why isn\'t A4 POD?
#include
#include
It's not POD because it breaks this rule for standard layout classes:
— either has no non-static data members in the most derived class and at most one base class with non-static data members, or has no base classes with non-static data members
Only one class in the inheritance lattice can have non-static data members. In this case, both
A
and A4
have.