I just do not understand why you're wrong. This code works.
template class test{ public: struct st1{ T a, b, c; }; struct st2{ T d, e, f; }; T foo1(st1 *st); st1 *foo2(); }; template typename test::st1 *foo2() { return 0; } template T test::foo1(typename st1 *st) { return 0; }
But this one does not work.
template class test{ public: struct st1{ T a, b, c; }; struct st2{ T d, e, f; }; T foo1(st1 *st); st1 *foo2(); st1 *foo3(st2 *st); }; template T test::foo1(typename st1 *st) { return 0; } template typename test::st1 *foo2() { return 0; } template typename test::st1 *foo3(typename st1 *st) { return 0; }