template <typename>
struct A
{
template <typename>
struct B
{
};
};
template <>
template <>
struct A<int>::B<char>
{
static void foo();
};
void A<int>::B<char>::foo()
{
}
int main()
{
}
vc++ compilation error message:
error C2906: 'void A<int>::B<char>::foo(void)': explicit specialization requires 'template <>'
What behavior is standard compliant in this case?
void A<int>::B<char>::foo()
isn't a simple member of an explicitly specialized class template in this case. It is a member of an explicitly specialized member class template that is specialized as a class template explicit specialization, isn't it? – Lowney