Megosztás a következőn keresztül:


C3855-ös fordítási hiba

"class": a "param" típusparaméter nem kompatibilis a deklarációval

Megjegyzések

A fordító nontípusú sablont vagy generikus paramétereket talált eltérő nevekkel. Ez akkor fordulhat elő, ha egy sablon specializáció definíciójában megadott sablonparaméter nem kompatibilis a deklarációjával.

Példák

Az alábbi példa C3855-öt hoz létre:

// C3855.cpp
template <int N>
struct C {
   void f();
};

template <char N>
void C<N>::f() {}   // C3855

Lehetséges megoldás:

// C3855b.cpp
// compile with: /c
template <int N>
struct C {
   void f();
};

template <int N>
void C<N>::f() {}

A C3855 általános használat esetén is előfordulhat:

// C3855c.cpp
// compile with: /clr
generic <class T>
ref struct GC1 {
   generic <class U>
   ref struct GC2;
};

generic <class T>
generic <class U>
generic <class V>
ref struct GC1<T>::GC2 { };   // C3855

Lehetséges megoldás:

// C3855d.cpp
// compile with: /clr /c
generic <class T>
ref struct GC1 {
   generic <class U>
   ref struct GC2;
};

generic <class T>
generic <class U>
ref struct GC1<T>::GC2 { };