Does anyone know why the following fails to compile (tested in MSVC2015)?
template<int N> // when this line is removed it compiles successfully
class A {
class B {
public:
class C {
};
};
void func(B b){} // compiles fine
void func(B::C c){} // generates warning C4346 and error C2061
};
It generates the following on the line marked with a comment:
warning C4346: 'A<N>::B::C': dependent name is not a type
error C2061: syntax error: identifier 'C'