Edit

Share via


Compiler Error C2574

'function': cannot be declared static

Remarks

Neither constructors nor destructors can be declared static.

Example

The following example generates C2574:

// C2574.cpp
// compile with: /c
struct S
{
    static S() {}   // C2574

    // Try the following line instead:
    // S() {}
};