次の方法で共有


コンパイラ エラー C2753

'template' : 部分的特殊化を、プライマリ テンプレートの引数リストと一致させることはできません

テンプレート引数リストがパラメーター リストと一致する場合、コンパイラでは同じテンプレートとして扱われます。 同じテンプレートを 2 回定義する方法は許可されません。

次の例では、C2753 を生成し、その修正方法を示しています。

// C2753.cpp
// compile with: cl /c C2753.cpp
template<class T>
struct A {};

template<class T>
struct A<T> {};   // C2753
// try the following line instead
// struct A<int> {};

template<class T, class U, class V, class W, class X>
struct B {};