Compiler Error C2600

'name' : uses 'identifier' in local class 'class' causing compiler-generated special member functions

The declaration of the member identifier caused the compiler to generate a member function, such as an assignment operator or a default constructor (a constructor taking no parameters), for the specified class. However, local classes cannot define member functions.

Members that are declared with the const modifier or that are references require the compiler to generate an assignment operator and a default constructor. This is because such members can only be initialized, not assigned new values.

The following is an example of this error:

void f()
{
   class C         // local class
   {
      const int i; // error: const member
   };

   C c;  // constructor needed to initialize c.i
}