Define a Method Signature with `typedef`

typedef Comparison<T> = int Function(T a, T b);

class A<T> {
  Comparison<T> compare;
}

Subscribe to My Newsletter

The latest programming-related news, articles and resources - sent to your inbox monthly. Unsubscribe anytime.