Compiler Error C3282

 

The new home for Visual Studio documentation is Visual Studio 2017 Documentation on docs.microsoft.com.

The latest version of this topic can be found at Compiler Error C3282.

generic parameter lists can only appear on managed or WinRTclasses, structs, or functions

A generic parameter list was used incorrectly. For more information, see Generics.

The following sample generates C3282 and shows how to fix it.

// C3282.cpp  
// compile with: /clr /c  
generic <typename T> int x;   // C3282  
  
ref struct GC0 {  
   generic <typename T> int x;   // C3282  
};  
  
// OK  
generic <typename T>  
ref class M {};  

Show: