1 2 3 4 5 6 7 8 9 10 11
#include <stddef.h> template <bool> struct StaticAssert; template <> struct StaticAssert<true> {}; struct MyPOD { int a; int b; int c; }; StaticAssert<(offsetof(MyPOD, a) == 0)> s;