swiftlang/swift

[SR-888] Sequence.minElement() and maxElement() should be protocol requirements (customization points)

Open

#43.500 geöffnet am 6. März 2016

Auf GitHub ansehen
 (5 Kommentare) (0 Reaktionen) (0 zugewiesene Personen)Swift (10.719 Forks)batch import
affects ABIgood first issuestandard libraryswift evolution proposal needed

Repository-Metriken

Stars
 (69.989 Stars)
PR-Merge-Metriken
 (Durchschn. Merge 8T 17h) (510 gemergte PRs in 30 T)

Beschreibung

Previous ID SR-888
Radar rdar://problem/24999603
Original Reporter @gribozavr
Type Bug
Status In Progress
Resolution
Votes 0
Component/s Standard Library
Labels Bug, AffectsABI, StarterBug, StarterProposal, swift-evolution-proposal-needed
Assignee akhilmantha (JIRA)
Priority Medium

md5: 38f233c0b4c0d1508b74875d0c159d05

Issue Description:

Some collections naturally maintain sorted order and can implement `minElement()` and `maxElement()` in O(1). Thus, these algorithms should be protocol requirements to allow collection-specific customizations.

Note that `minElement()` and `maxElement()` that take predicates should continue to be pure extensions.

Contributor Guide