public static bool CompareList <T> (CompareProc <T> proc, List <T> list) { bool res = true; for (int i = 0; i < list.Count - 1; ++i) { res = res && proc(list[i], list[i + 1]); } return(res); }
static extern unsafe void qsort(void *items, IntPtr itemCount, IntPtr itemSize, CompareProc proc);
// IntPtr (size_t) と int との変換の手間を省くためのオーバーロード static unsafe void qsort(void *items, int itemCount, int itemSize, CompareProc proc) { qsort(items, new IntPtr(itemCount), new IntPtr(itemSize), proc); }
static extern unsafe void stdcall_qsort(void *items, int itemCount, int itemSize, CompareProc proc);