Advertisement
Guest User

Untitled

a guest
Aug 18th, 2019
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.32 KB | None | 0 0
  1. public class TupleList<T1, T2> : List<Tuple<T1, T2>> where T1 : IComparable
  2. {
  3. public void Add(T1 item, T2 item2)
  4. {
  5. Add(new Tuple<T1, T2>(item, item2));
  6. }
  7.  
  8. public new void Sort()
  9. {
  10. Comparison<Tuple<T1, T2>> c = (a, b) => a.Item1.CompareTo(b.Item1);
  11. base.Sort(c);
  12. }
  13.  
  14. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement