次の方法で共有


コンパイラ エラー C3268

'function': ジェネリック クラスのメンバー関数またはジェネリック関数に、変数パラメーター リストを含めることはできません

解説

/clr:pure および /clr:safe コンパイラ オプションは Visual Studio 2015 では非推奨とされており、Visual Studio 2017 ではサポートされていません。

詳細については、「ジェネリック」を参照してください。

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

// C3268.cpp
// compile with: /clr:pure /c
generic <class ItemType>
void Test(ItemType item, ...) {}   // C3268
// try the following line instead
// void Test(ItemType item) {}

generic <class ItemType2>
ref struct MyStruct { void Test(...){} };   // C3268
// try the following line instead
// ref struct MyStruct { void Test2(){} };   // OK