C# generics: How to compare values of generic types?
I realize there are already a handful of questions related to this seemingly simple problem - but none of the threads gives an exhaustive or workable answer, so here I have it reduced to a minimal sample:

    public class Foo<T> where T : IComparable
    {
        private T _minimumValue = default(T);

        public bool IsInRange(T value) 
        {
            return (value >= _minimumValue); // <-- Error here
        }
    }

The error is: *Operator '>=' cannot be applied to operands of type 'T' and 'T'*

WTF!? T is already constrained to IComparable, and even when constraining it to value types (where T: struct), we still can't apply any of the operators <, >, <=, >=, == or !=. (I know that workarounds involving Equals() exist for '==' and '!=', but it doesn't help for the relational operators).

So, 2 questions:

 1. **Why** do we observe this weird behaviour? What keeps us from comparing the values of generic types which are *known* to be IComparable? Doesn't it somehow defeat the entire purpose of generic constraints?
 2. Any idea how to resolve this, or at least work around it?

C# generics: How to compare values of generic types?
===

I realize there are already a handful of questions related to this seemingly simple problem - but none of the threads gives an exhaustive or workable answer, so here I have it reduced to a minimal sample:

    public class Foo<T> where T : IComparable
    {
        private T _minimumValue = default(T);

        public bool IsInRange(T value) 
        {
            return (value >= _minimumValue); // <-- Error here
        }
    }

The error is: *Operator '>=' cannot be applied to operands of type 'T' and 'T'*

WTF!? T is already constrained to IComparable, and even when constraining it to value types (where T: struct), we still can't apply any of the operators <, >, <=, >=, == or !=. (I know that workarounds involving Equals() exist for '==' and '!=', but it doesn't help for the relational operators).

So, 2 questions:

 1. **Why** do we observe this weird behaviour? What keeps us from comparing the values of generic types which are *known* to be IComparable? Doesn't it somehow defeat the entire purpose of generic constraints?
 2. Any idea how to resolve this, or at least work around it?
