Kompilatorfel C2581

"type" : den statiska funktionen operator =är ogiltig

Anmärkningar

Tilldelningsoperatorn (=) deklareras felaktigt som static. Tilldelningsoperatorer kan inte vara static. Mer information finns iUser-Defined Operatorer (C++/CLI).

Exempel

I följande exempel genereras C2581.

// C2581.cpp
// compile with: /clr /c
ref struct Y {
   static Y ^ operator = (Y^ me, int i);   // C2581
   Y^ operator =(int i);   // OK
};