mirror of
https://github.com/apple/swift-collections
synced 2026-11-24 04:27:53 +00:00
842f125c removed the trait conditions around the Iterable APIs, but
UniqueDeque only got its conformance through Container in ContainersPreview.
RigidDeque had no underestimatedCount, so it was 0 through Iterable.
31 lines
936 B
Swift
31 lines
936 B
Swift
//===----------------------------------------------------------------------===//
|
|
//
|
|
// This source file is part of the Swift Collections open source project
|
|
//
|
|
// Copyright (c) 2026 Apple Inc. and the Swift project authors
|
|
// Licensed under Apache License v2.0 with Runtime Library Exception
|
|
//
|
|
// See https://swift.org/LICENSE.txt for license information
|
|
//
|
|
// SPDX-License-Identifier: Apache-2.0 WITH Swift-exception
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
#if compiler(>=6.4)
|
|
|
|
@available(SwiftStdlib 5.0, *)
|
|
extension UniqueDeque: Iterable where Element: ~Copyable {
|
|
public typealias BorrowingIterator = RigidDeque<Element>.BorrowingIterator
|
|
|
|
@inlinable
|
|
public var underestimatedCount: Int { count }
|
|
|
|
@_alwaysEmitIntoClient
|
|
@_lifetime(borrow self)
|
|
public borrowing func makeBorrowingIterator() -> BorrowingIterator {
|
|
BorrowingIterator(_deque: self._storage)
|
|
}
|
|
}
|
|
|
|
#endif
|