Nuta
Dostęp do tej strony wymaga autoryzacji. Możesz spróbować zalogować się lub zmienić katalogi.
Dostęp do tej strony wymaga autoryzacji. Możesz spróbować zmienić katalogi.
"type": klasa nie jest typem klasy
Uwagi
Najczęstszą przyczyną tego błędu jest to, że w punkcie definicji znajduje się więcej list parametrów ogólnych lub szablonów niż w punkcie deklaracji.
Przykłady
Poniższy przykład generuje kod C3856:
// C3856.cpp
template <class T>
struct S {
template <class T1>
struct S1;
void f();
};
template <class T> // C3856
template <class T1>
template <class T2> // extra template parameter list in definition
struct S<T>::S1{};
Możliwe rozwiązanie:
// C3856b.cpp
// compile with: /c
template <class T>
struct S {
template <class T1>
struct S1;
void f();
};
template <class T>
template <class T1>
struct S<T>::S1{};
C3856 może również wystąpić w przypadku używania typów ogólnych:
// C3856c.cpp
// compile with: /clr
generic <class T>
ref struct GS {
generic <class U>
ref struct GS2;
};
generic <class T>
generic <class U>
generic <class V>
ref struct GS<T>::GS2 {}; // C3856
Możliwe rozwiązanie:
// C3856d.cpp
// compile with: /clr /c
generic <class T>
ref struct GS {
generic <class U>
ref struct GS2;
};
generic <class T>
generic <class U>
ref struct GS<T>::GS2 {};