Kompilatorfel C2395

"your_type::operator'op'' : CLR- eller WinRT-operatorn är inte giltig. Minst en parameter måste vara av följande typer: 'T', 'T%', 'T&', 'T^', 'T^%', 'T^&', where T = 'your_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

Följande exempel genererar C2395 och visar hur du åtgärdar det:

// C2395.cpp
// compile with: /clr /c
value struct V {
   static V operator *(int i, char c);   // C2395

   // OK
   static V operator *(V v, char c);
   // or
   static V operator *(int i, V& rv);
};