El siguiente código no se compila. Aparece un mensaje de error: error C2039: 'Asub': no es miembro de 'C'Tipos "heredados" utilizando CRTP y typedef
¿Alguien me puede ayudar a entender esto?
Probado VS2008 & 2010 compilador.
template <class T>
class B
{
typedef int Asub;
public:
void DoSomething(typename T::Asub it)
{
}
};
class C : public B<C>
{
public:
typedef int Asub;
};
class A
{
public:
typedef int Asub;
};
int _tmain(int argc, _TCHAR* argv[])
{
C theThing;
theThing.DoSomething(C::Asub());
return 0;
}
usted debe siempre * * p rovide los números de línea con errores de compilación. – abelenky
¿Qué es 'struct A' para en el ejemplo? – AlwaysLearning