using System; public interface IComparer { void Compare (T a); } class IC : IComparer> { public void Compare (Foo a) { } } public struct Foo { public K Value; public Foo (K value) { Value = value; } } public class List { public virtual void Sort (IComparer c, T t) { Sorting.IntroSort (c, t); } } public class Sorting { public static void IntroSort (IComparer c, T t) { new Sorter (c, 4, t).InsertionSort (0); } class Sorter { IComparer c; T[] a; public Sorter (IComparer c, int size, T item) { this.c = c; a = new T [size]; } internal void InsertionSort (int i) { T other; c.Compare (other = a[i]); } } } class X { public static void Main () { List> list = new List> (); Foo foo = new Foo (3); list.Sort (new IC (), foo); } }