How do I implement a LINQ-type IComparer<T> overload where T implements IComparable<T>?
<p>I am implementing a class that in the style of the LINQ libraries has an overload for a custom IComparer. (e.g. OrderBy: <code>OrderBy&lt;TSource, TKey&gt;(IEnumerable&lt;TSource&gt;, Func&lt;TSource, TKey&gt;)</code> and <code>OrderBy&lt;TSource, TKey&gt;(IEnumerable&lt;TSource&gt;, Func&lt;TSource, TKey&gt;, IComparer&lt;TKey&gt;)</code>). </p>

<p>I would like to implement the 2-argument overload in terms of the 1-argument overload. Something like the following: </p>

<pre><code>T Method&lt;T&gt;(IEnumerable&lt;T&gt; collection, IComparer&lt;T&gt; comparer)
{
    // Do something that returns a T
}

T Method&lt;T&gt;(IEnumerable&lt;T&gt; collection) where T: IComparable&lt;T&gt;
{
    IComparer&lt;T&gt; comparer = /*what goes here?*/;
    return Method(collection, comparer);
}
</code></pre>

<p>In this respect, the question boils down to asking, how do I obtain an instance of IComparer for a type that implements IComparable?</p>
