Contents

compare(_:_:)

Provides the relative ordering of two elements based on the sort order of the comparator.

Declaration

func compare(_ lhs: Self.Compared, _ rhs: Self.Compared) -> ComparisonResult

Parameters

  • lhs:

    The first element to compare.

  • rhs:

    The second element to compare.

Return Value

The relative ordering between the two elements according to the sort order of the comparator.

See Also

Using a Comparator