[SR-4746] Let enumerated() count from specified number #47323
Labels
affects ABI
Flag: Affects ABI
feature
A feature request or implementation
improvement
standard library
Area: Standard library umbrella
Attachment: Download
Additional Detail from JIRA
md5: 6e761919c93c823a5699ebfa4cd258e1
Issue Description:
The
enumerated()
method defined in an extension onprotocol Sequence
always counts from 0.When you need the numbers to be counting up from different index, you have to post process the resulting tuple in an inconvenient way.
We could provide an option to count elements from a user specified offset:
If implemented with default parameter, this does not change the usage for existing code, being source compatible with Swift 3. I’m not sure if this change affects ABI, of if it requires passing through swift-evolution process...
The text was updated successfully, but these errors were encountered: