Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SR-11479] Conditionally make EnumeratedSequence conform to Collection #53879

Open
swift-ci opened this issue Sep 16, 2019 · 1 comment
Open
Labels
improvement standard library Area: Standard library umbrella

Comments

@swift-ci
Copy link
Collaborator

Previous ID SR-11479
Radar None
Original Reporter CTMacUser (JIRA User)
Type Improvement
Additional Detail from JIRA
Votes 0
Component/s Standard Library
Labels Improvement
Assignee None
Priority Medium

md5: 76c1052c3df9639d9f32660521687241

Issue Description:

As described in the summary, EnumeratedSequence should conform to Collection when its wrapped sequence does.

The implementation would probably need to cache the element's offset in the index. The problem is that endIndex would need to know the count of the wrapped collection. To make performance reasonable, the collection would need to be a RandomAccessCollection so we can generate count in constant time.

(So it's more "Make EnumeratedSequence conditionally conform to RandomAccessCollection.)

@belkadan
Copy link
Contributor

Removing Starter Bug for now – we don't have an implementation of "conformances with availability" or "backwards-deployable conformances" yet, so we don't want someone picking it up just yet. cc @lorentey

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
improvement standard library Area: Standard library umbrella
Projects
None yet
Development

No branches or pull requests

2 participants