partitioningIndex(where:)

Returns the start index of the partition of a collection that matches the given predicate.

Partition.swift:188
func partitioningIndex(where belongsInSecondPartition: (Element) throws -> Bool) rethrows -> Index

Parameters

belongsInSecondPartition

A predicate that partitions the collection.

Returns

The index of the first element in the collection for which predicate returns true, or endIndex if there are no elements for which predicate returns true.

The collection must already be partitioned according to the predicate. That is, there should be an index i where for every element in collection[..<i] the predicate is false, and for every element in collection[i...] the predicate is true.