ComparableImpl.CompareToObject<T> method

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.

Return Value

The result of IComparable{T}.CompareTo.

Exceptions

exception condition
ArgumentException obj is not an instance of T.

Remarks

Does not check whether that is null, since this should always be used.

See Also