Poniższy kod nie jest kompilowany. Pojawia się komunikat o błędzie: błąd C2039: "Asub": nie jest członkiem "C""Dziedziczone" typy przy użyciu CRTP i typedef
Czy ktoś może mi pomóc to zrozumieć?
Wypróbowany VS2008 & 2010 kompilator.
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;
}
powinieneś zawsze * p * liczby linii rovide z błędami kompilacji. – abelenky
Co to jest "struct A" dla przykładu? – AlwaysLearning