-
Notifications
You must be signed in to change notification settings - Fork 10.7k
[SR-3419] Strides should be collections #46007
Copy link
Copy link
Open
Labels
affects ABIFlag: Affects ABIFlag: Affects ABIgood first issueGood for newcomersGood for newcomersimprovementstandard libraryArea: Standard library umbrellaArea: Standard library umbrellaswift evolution proposal neededFlag → feature: A feature that warrants a Swift evolution proposalFlag → feature: A feature that warrants a Swift evolution proposal
Metadata
Metadata
Assignees
Labels
affects ABIFlag: Affects ABIFlag: Affects ABIgood first issueGood for newcomersGood for newcomersimprovementstandard libraryArea: Standard library umbrellaArea: Standard library umbrellaswift evolution proposal neededFlag → feature: A feature that warrants a Swift evolution proposalFlag → feature: A feature that warrants a Swift evolution proposal
Additional Detail from JIRA
md5: 20684cd6a789b38a9426158bdf2d0b60
Issue Description:
In Swift 3.0,
StrideToandStrideThroughconform toSequence, but notCollection.While they can't be bi-directional or random-access, as the last (or abitrary) element can't necessarily be reached in O( n ) for all strideable types, it should be possible to make them forward-only collections. One straightforward implementation would be to make the index each value zipped with a count (for
Comparablepurposes).Once we have conditional conformance, it should be possible to make specific strides (e.g. ones over integers) conform to random access.