ComparingOrderedSet<E> constructor

ComparingOrderedSet<E>({
  1. int compare(
    1. E e1,
    2. E e2
    )?,
  2. bool strictMode = true,
})

Creates a new OrderedSet with the given compare function.

If the compare function is omitted, it defaults to Comparable.compare, and the elements must be comparable.

Implementation

ComparingOrderedSet({
  int Function(E e1, E e2)? compare,
  this.strictMode = true,
}) : _comparator = compare ?? _defaultCompare<E>();