mirror of
https://github.com/apple/swift-collections
synced 2026-11-26 04:47:48 +00:00
Replace Container with a far less powerful (but more universal) Iterable construct
I’m hoping Container will return later.
This commit is contained in:
26 files changed
+1071
-413
No files matched your search
@@ -177,12 +177,16 @@ extension UniqueArray where Element: ~Copyable {
|
||||
|
||||
#if COLLECTIONS_UNSTABLE_CONTAINERS_PREVIEW
|
||||
@available(SwiftStdlib 5.0, *)
|
||||
extension UniqueArray: Container where Element: ~Copyable {
|
||||
extension UniqueArray: Iterable where Element: ~Copyable {
|
||||
public typealias BorrowIterator = RigidArray<Element>.BorrowIterator
|
||||
|
||||
public var estimatedCount: ContainersPreview.EstimatedCount {
|
||||
.exactly(count)
|
||||
}
|
||||
|
||||
@_alwaysEmitIntoClient
|
||||
@inline(__always)
|
||||
public func startBorrowIteration() -> Span<Element> {
|
||||
public func startBorrowIteration() -> BorrowIterator {
|
||||
self._storage.startBorrowIteration()
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user