public protocol MutableCollectionAlgorithms : MutableCollection where SubSequence : MutableCollectionAlgorithms
Provides customization points for
If incorporated into the standard library, these requirements would just be
MutableCollection. In the meantime, you can declare conformance
of a collection to
MutableCollectionAlgorithms to get these customization
points to be used from other algorithms defined on
Rotates the elements of the collection so that the element at
middleends up first.
@discardableResult mutating mutating func rotate(shiftingToStart middle: Index) -> Index
The new index of the element that was first pre-rotation.
Moves all elements satisfying
isSuffixElementinto a suffix of the collection, preserving their relative order, and returns the start of the resulting suffix.
ComplexityO(n) where n is the number of elements.
@discardableResult mutating func stablePartition( isSuffixElement: (Element) throws -> Bool ) rethrows -> Index