I wrote a Generic Class:
public class Interval where T : IComparable // for checking that Start < End
{
public T Start { ge
The compiler does this so you don't write buggy code, its the whole point of generics and the concept of type safe programming.
If you need a method that subtracts dates write one that accepts a date, and if you need another one for integers, guess what you should write one for integers. Generics are not there so that the compiler can assume responsibility for any type. Think about it what if I wanted the difference between two objects, how would I do that with your generic method?
Or as @Reed Copsey mentioned you can constrain a class to it.