Partial specialization of member function [duplicate]
问题 This question already has answers here : Closed 7 years ago . Possible Duplicate: “invalid use of incomplete type” error with partial template specialization Why is it that I can do this: template <typename T> struct A { void foo(int); }; template <> void A<int>::foo(int) { } but not this: template <typename> struct C {}; template <typename T> struct A { void foo(int); }; template <typename T> void A<C<T> >::foo(int) { } For the second case, GCC gives the following error: test.cpp:10:23: