Commits

David Farler committed 0d1b03086d7
Add slicing extensions to SequenceType and CollectionType. rdar://problem/21663830 Add the following new requirements to SequenceType with default implementations: - dropFirst(n) - dropLast(n) - prefix(n) - suffix(n) - split(n) In addition, provide specialized default implementations of these for CollectionTypes with forward, bidirectional, and random-access Index types where possible. Add the following new requirements to CollectionType with default implementations: - prefixThrough(n) - prefixUpTo(n) - suffixFrom(n) - split() // isSeparator closure Add the following convenience APIs: - dropFirst() -> calls dropFirst(1) - dropLast() -> calls dropLast(1) Add a tentative underscored API: - split() // takes Equatable separator. Some APIs have undefined behavior when creating slices where the endpoints go beyond the bounds of the underlying collection. This will be fixed later by trapping creation of slices with invalid indices (rdar://problem/21822657). Swift SVN r30371