次の方法で共有


コンパイラ エラー C3190

指定されたテンプレート引数を伴う 'instantiation' は、'type' のメンバー関数の明示的なインスタンス化ではありません

コンパイラが、明示的な関数のインスタンス化の試行を検出しました。ただし、指定された型引数は、使用できるどの関数にも一致しません。

次の例では C3190 が生成されます。

// C3190.cpp
// compile with: /LD
template<class T>
struct A {
   A(int x = 0) {
   }
   A(int x, int y) {
   }
};

template A<float>::A();   // C3190
// try the following line instead
// template A<int>::A(int);

struct Y {
   template<class T> void f(T);
};

template<class T> void Y::f(T) { }

template void Y::f(int,int);   // C3190

template<class OT> class X {
   template<class T> void f2(T,OT);
};

template<class OT> template<class T> void X<OT>::f2(T,OT) {}

template void X<float>::f2<int>(int,char);   // C3190
// try one of the following lines instead
// template void X<char>::f2(int, char);
// template void X<char>::f2<int>(int,char);
// template void X<char>::f2<>(int,char);