Condividi tramite


Errore del compilatore C2394

'type:: operator operator': operatore CLR/WinRT non valido. Almeno un parametro deve essere dei tipi seguenti: 'T^', 'T^%', 'T^&', dove T = 'type'

Osservazioni:

Un operatore in un tipo Windows Runtime o gestito non dispone nemmeno di un parametro il cui tipo sia uguale al tipo del valore restituito dell'operatore.

Example

L'esempio seguente genera l'errore 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);
};