'class': 型パラメーター 'param' は宣言と互換性がありません
コンパイラは、異なる名前の非型テンプレートまたはジェネリック パラメーターを検出しました。 これは、テンプレート特殊化の定義で指定されたテンプレート パラメーターが、その宣言と互換性がない場合に発生する可能性があります。
次の例では C3855 が生成されます:
// C3855.cpp
template <int N>
struct C {
void f();
};
template <char N>
void C<N>::f() {} // C3855
考えられる解決方法:
// C3855b.cpp
// compile with: /c
template <int N>
struct C {
void f();
};
template <int N>
void C<N>::f() {}
C3855 は、ジェネリックを使用しているときも発生します:
// 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
考えられる解決方法:
// 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 { };