sto cercando il seguente:Impossibile confrontare T value1 con T value2 = default (T). Perché e come farlo in C#?
T value1 = el.value; // it's of type T already
T value2 = default(T);
if (value1 != value2) // gives the following error: Operator '!=' cannot be applied to operands of type 'T' and 'T'
{
// ...
}
Così, come potrei confrontare i due valori? E perché si verifica questo errore?
Grazie in anticipo!
Assicurarsi T implementa le classi di tipo iCompare-ish, e il metodo o la classe che definisce T ha quei riferimenti nella dichiarazione. – asawyer