Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All
Expand Minimize

Compiler Error C2892

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() {}
   };
}
Show:
© 2015 Microsoft