Sorter<T> typedef

Sorter<T> = int Function(T left, T right)

Takes two values of type T and computes their sort order, represented by a returned integer value.

The rules of the comparison are as follows:

  • If left is less than right, a negative number is returned.
  • If left is greater than right, a positive number is returned.
  • If left and right are equal, 0 is returned.

Implementation

typedef Sorter<T> = int Function(T left, T right);