Skip to content

Latest commit

 

History

History
37 lines (31 loc) · 722 Bytes

compiler-error-c3226.md

File metadata and controls

37 lines (31 loc) · 722 Bytes
description title ms.date f1_keywords helpviewer_keywords ms.assetid
Learn more about: Compiler Error C3226
Compiler Error C3226
11/04/2016
C3226
C3226
636106ca-6f4e-4303-a6a0-8803221ec67d

Compiler Error C3226

A template declaration is not allowed inside a generic declaration

Use a generic declaration inside a generic class.

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 {};
};