Exemplo n.º 1
0
 // Comparisons on generics will need to use IEquatable / IComparable methods - operators will not work in C#
 public static bool Less <T>(this orderedSlice <T> s, nint i, nint j) where T : IComparable <T> => s[i].CompareTo(s[j]) < 0;
Exemplo n.º 2
0
 public static void Swap <T>(this orderedSlice <T> s, nint i, nint j) where T : IComparable <T> => (s[i], s[j]) = (s[j], s[i]);
Exemplo n.º 3
0
 public static nint Len <T>(this orderedSlice <T> s) where T : IComparable <T> => s.Length;