using System; using System.Collections.Generic; public class NaturalComparer : IComparer where T: IComparable { public int Compare (T a, T b) { return a.CompareTo (b); } } public class X { class Test : IComparable { public int CompareTo (Test that) { return 0; } public bool Equals (Test that) { return false; } } public static void Main () { IComparer cmp = new NaturalComparer (); Test a = new Test (); Test b = new Test (); cmp.Compare (a, b); } }