The following gives an "Internal Compiler Error" on MSVC++ 10 Sp1.
And on gcc:
b.cpp:16:12: error: explicit specialization in non-namespace scope ‘struct A::B’
b.cpp:16:28: error: template-id ‘f’ in declaration of primary template
//class template
template< class T>
struct A{
//struct B {}; //Remove the comment and it will compile!
};
//partial specialization
template< class T >
struct A< T* >
{
struct B {
template<class C> void f(){}
//"Internal Compiler Error"
template<> void f<int>(){};
};
};
However, if the comments before struct B
is removed it will compile!
I don't understand the problem!