Compiler Error C2892
Collapse the table of content
Expand the table of content
The document is archived and information here might be outdated

Compiler Error C2892

Error Message

local class shall not have member templates

Templated member functions are not valid in a class that is defined in a function.

The following sample generates C2892:

// C2892.cpp
int main() {
   struct local {
      template<class T>   // C2892
      void f() {}
© 2016 Microsoft