Sort collection
in-place according to isOrderedBefore
.
The sorting algorithm is not stable (can change the relative order of
elements for which isOrderedBefore
does not establish an order).
Requires: isOrderedBefore
is a strict weak ordering
over elements
.
Declaration
func sort<C : MutableCollectionType where C.Index : RandomAccessIndexType>(inout collection: C, isOrderedBefore: (C.Generator.Element, C.Generator.Element) -> Bool)