Sdílet prostřednictvím


Chyba kompilátoru C3855

'class': parametr type 'param' není kompatibilní s deklarací.

Poznámky

Kompilátor našel netypovou šablonu nebo obecné parametry s různými názvy. K tomu může dojít, když zadaný parametr šablony v definici specializace šablony není kompatibilní s jeho deklarací.

Examples

Následující příklad generuje C3855:

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

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

Možné řešení:

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

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

K C3855 může také dojít při použití obecných typů:

// 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

Možné řešení:

// 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 { };