Ошибка компилятора C3226Compiler Error C3226
Объявление шаблона недопустимо внутри универсального объявленияA template declaration is not allowed inside a generic declaration
Используйте универсальное объявление в универсальном классе.Use a generic declaration inside a generic class.
Следующий пример приводит к возникновению ошибки C3226:The following sample generates C3226:
// C3226.cpp
// compile with: /clr
generic <class T>
ref class C {
template <class T1> // C3226
ref struct S1 {};
};
В следующем примере показано возможное решение:The following sample demonstrates a possible resolution:
// C3226b.cpp
// compile with: /clr /c
generic <class T>
ref class C {
generic <class T1>
ref struct S1 {};
};