28 static inline void QSortT(T *base, uint num,
int (CDECL *comparator)(
const T*,
const T*),
bool desc =
false)
32 qsort(base, num,
sizeof(T), (
int (CDECL *)(
const void *,
const void *))comparator);
52 static inline void GSortT(T *base, uint num,
int (CDECL *comparator)(
const T*,
const T*),
bool desc =
false)
57 assert(comparator != NULL);
64 const int diff = comparator(a, b);
65 if ((!desc && diff <= 0) || (desc && diff >= 0)) {
80 if (a == base)
continue;
static void Swap(T &a, T &b)
Type safe swap operation.
static void GSortT(T *base, uint num, int(CDECL *comparator)(const T *, const T *), bool desc=false)
Type safe Gnome Sort.
static void MemReverseT(T *ptr1, T *ptr2)
Type safe memory reverse operation.
Functions related to memory operations.
static void QSortT(T *base, uint num, int(CDECL *comparator)(const T *, const T *), bool desc=false)
Type safe qsort()