Comparer<T>.Default Property
<p>This question comes from this <a href="http://geekswithblogs.net/BlackRabbitCoder/archive/2011/01/20/c.net-little-wonders-comparerlttgt.default.aspx" rel="nofollow">Little Wonders: <code>Comparer&lt;T&gt;.Default</code></a>  . I am wondering what the author wrote in the line:</p>

<blockquote>
  <p>If the type you want to compare already implements <code>IComparable&lt;T&gt;</code> or
  if the type is <code>System.Nullable&lt;T&gt;</code> where T implements <code>IComparable</code>,
  there is a class in the <strong>System.Collections.Generic namespace called
  <code>Comparer&lt;T&gt;</code> which exposes a property called Default that will create a
  singleton that represents the default comparer for items of that
  type.</strong></p>
</blockquote>

<p>So for example :</p>

<p>I have a class :</p>

<pre><code>class Foo : IComparable&lt;Foo&gt; { ... }
public class FooComparer : IComparer&lt;Foo&gt; { ... }
</code></pre>

<p>Comparer class implemented as <code>public abstract class Comparer&lt;T&gt; : IComparer, IComparer&lt;T&gt;</code> . My question is how Default property works overall , what it does and how it works?</p>

<p>Thanks</p>
