title: Using IComparer<T>.Compare(T,T) in C#
body: <p>I've been trying to make a generic  Reverse Priority Queue, but int the EnQueue, but I still can't manage the errors that come with using IComparer.</p>
  
  <p>The Error: Error    1   An object reference is required for the non-static field, method, or property 'System.Collections.Generic.IComparer.Compare(T, T)'</p>
  
  <pre><code>public void inQ(T dat)//adding element in place, increasing order
      {
          if (start == null)//that means that the RPQ is empty
          {
              start = new node(dat);
              return;
          }
          if (IComparer&lt;T&gt;.Compare(start.data, dat) &gt; 0)//Doesn't work
          {
              start = new node(dat, start);
              return;
          }
          //Default Case
          //no need for an else, actually
          node q = start;
          while (q.next != null &amp;&amp; Comparer&lt;T&gt;.Default.Compare(q.next.data, dat) &lt; 0)//Works Perfectly
              q++;
          q.next = new node(dat, q.next);
      }
  </code></pre>