Container: Add makeBorrowingIterator(from:) and currentIndex(of:) requirements

This commit is contained in:
Karoy Lorentey committed 2026-07-07 14:21:54 -07:00
1 parent 721b5bce41
commit a80c9d1257
12 files changed
+186 -19

No files matched your search

@@ -36,7 +36,20 @@ extension UniqueArray: Iterable_ where Element: ~Copyable {
#if compiler(>=6.4) && UnstableContainersPreview
@available(SwiftStdlib 5.0, *)
extension UniqueArray: Container where Element: ~Copyable {}
extension UniqueArray: Container where Element: ~Copyable {
@_alwaysEmitIntoClient
@_lifetime(borrow self)
public func makeBorrowingIterator(
from start: Index
) -> BorrowingIterator_ {
_storage.makeBorrowingIterator(from: start)
}
@_alwaysEmitIntoClient
public func currentIndex(of iterator: borrowing BorrowingIterator_) -> Index {
_storage.currentIndex(of: iterator)
}
}
@available(SwiftStdlib 5.0, *)
extension UniqueArray: BidirectionalContainer where Element: ~Copyable {}