Compiler Error C2823


The new home for Visual Studio documentation is Visual Studio 2017 Documentation on

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

a typedef template is illegal

Templates are not allowed in typedef definitions.

The following sample generates C2823:

// C2823.cpp  
template<class T>  
typedef struct x {  
   T i;   // C2823 can't use T, specify data type and delete template  
   int i;   // OK  
} x1;