template class Vector; template class List { public: void push_back(T); struct node {}; node *head; unsigned size; }; namespace A { class Y { template friend class WhereAmI; }; } template class A::WhereAmI { public: static void func() {} }; template struct Outer { struct Inner {}; };