Kompilatorfel C2394

"type::operator operator": CLR/WinRT-operatorn är inte giltig. Minst en parameter måste vara av följande typer: 'T^', 'T^%', 'T^&', där T = 'type'

Anmärkningar

En operator i en Windows Runtime eller hanterad typ hade inte minst en parameter vars typ är samma som typen av operatorns returvärde.

Example

I följande exempel genereras C2394:

// C2394.cpp
// compile with: /clr /c
ref struct Y {
   static Y^ operator -(int i, char c);   // C2394

   // OK
   static Y^ operator -(Y^ hY, char c);
   // or
   static Y^ operator -(int i, Y^& rhY);
};