M
Michel Walsh
Question:
public static Boolean In<T>(T x, param T[ ] y) where T : struct,
IComparable<T>
{
for(int i=0; i<y.Length; i++)
{
if(x==y) return true;
}
return false;
}
generates the compilation error that == cannot be applied to operands of
type 'T' and 'T'...
Can it be corrected? (Cannot use Contains and a list, at that point, the
snippet is just a simplified illustration)
Vanderghast, Access MVP
public static Boolean In<T>(T x, param T[ ] y) where T : struct,
IComparable<T>
{
for(int i=0; i<y.Length; i++)
{
if(x==y) return true;
}
return false;
}
generates the compilation error that == cannot be applied to operands of
type 'T' and 'T'...
Can it be corrected? (Cannot use Contains and a list, at that point, the
snippet is just a simplified illustration)
Vanderghast, Access MVP