Implements IComparable.CompareTo using IComparable{T}.CompareTo.
public static int CompareToObject<T>(T that, object? obj)
where T : IComparable<T>
parameter | description |
---|---|
that | An instance of IComparable{T}. |
obj | The object to compare to. |
The result of IComparable{T}.CompareTo.
exception | condition |
---|---|
ArgumentException | obj is not an instance of T. |
Does not check whether that is null, since this
should always be used.