Basically I have the following:
public static bool IsBetween<T>(this T value, T a, T b)
where T : IComparable
{
...
}
public static bool IsBetween<T>(this T value, T a, T b)
where T : IComparable<T>
{
...
}
The problem is I can't do this because you can't have a member with the same signature, even if the constraints are different. But, there is no way to state that the constraint is either IComparable
OR IComparable<T>
. So, I'm not sure what to do here outside of just picking one and going with it. And, no matter which one I pick I'm losing out on the other because they are separate and don't inherit from each other (which makes sense).
Am I missing something here in that is there a way to accomplish using both, or am I going to have to pick one (probably the generic version)?