Dean
❔ Is a generic with a where clause equivalent to passing the same type through as a parameter
Is there any difference between the following 2 methods?
public void DoSomething<T>(T value) where T : class, IComparable
{
int result = value.CompareTo(10);
Console.WriteLine(result);
}
public void DoSomething(IComparable value)
{
int result = value.CompareTo(10);
Console.WriteLine(result);
}
23 replies