1 2 3 4 5 6 7 8 9 10 11 12 13
struct Base { int x; }; template <typename T> struct A { static const int N = sizeof(static_cast<Base*>(T())); int a[N]; }; struct Derived : Base { A<Derived*> a; };