mirror of
https://github.com/apple/swift-collections
synced 2026-11-28 05:04:21 +00:00
[ContainersPreview] Exhibit A in the case against prototyping things in the stdlib 😞
This commit is contained in:
56 files changed
+200
-98
No files matched your search
@@ -343,6 +343,7 @@ extension RigidArray {
|
||||
}
|
||||
|
||||
#if compiler(>=6.4) && COLLECTIONS_UNSTABLE_CONTAINERS_PREVIEW
|
||||
@available(SwiftStdlib 6.4, *)
|
||||
@inlinable
|
||||
internal mutating func _append<
|
||||
Source: BorrowingSequence<Element> & ~Copyable & ~Escapable
|
||||
@@ -364,6 +365,7 @@ extension RigidArray {
|
||||
/// - newElements: A container whose contents to copy into the array.
|
||||
///
|
||||
/// - Complexity: O(`newElements.count`)
|
||||
@available(SwiftStdlib 6.4, *)
|
||||
@_alwaysEmitIntoClient
|
||||
@inline(__always)
|
||||
public mutating func append<
|
||||
@@ -406,6 +408,7 @@ extension RigidArray {
|
||||
/// - newElements: The new elements to copy into the array.
|
||||
///
|
||||
/// - Complexity: O(*m*), where *m* is the length of `newElements`.
|
||||
@available(SwiftStdlib 6.4, *)
|
||||
@_alwaysEmitIntoClient
|
||||
@inline(__always)
|
||||
public mutating func append<
|
||||
|
||||
@@ -19,13 +19,9 @@ import ContainersPreview
|
||||
#if compiler(>=6.2)
|
||||
|
||||
#if compiler(>=6.4) && COLLECTIONS_UNSTABLE_CONTAINERS_PREVIEW
|
||||
@available(SwiftStdlib 5.0, *)
|
||||
@available(SwiftStdlib 6.4, *)
|
||||
extension RigidArray: BorrowingSequence where Element: ~Copyable {
|
||||
public typealias BorrowingIterator = SpanIterator<Element>
|
||||
|
||||
@inlinable
|
||||
public var underestimatedCount: Int { count }
|
||||
|
||||
@_alwaysEmitIntoClient
|
||||
@inline(__always)
|
||||
public func makeBorrowingIterator() -> BorrowingIterator {
|
||||
@@ -55,6 +51,9 @@ extension RigidArray: RangeReplaceableContainer where Element: ~Copyable {}
|
||||
|
||||
@available(SwiftStdlib 5.0, *)
|
||||
extension RigidArray where Element: ~Copyable {
|
||||
@inlinable
|
||||
public var underestimatedCount: Int { count }
|
||||
|
||||
/// A Boolean value indicating whether this array contains no elements.
|
||||
///
|
||||
/// - Complexity: O(1)
|
||||
|
||||
@@ -122,6 +122,7 @@ extension RigidArray /*where Element: Copyable*/ {
|
||||
/// just enough capacity to store the contents.
|
||||
/// - contents: The container whose contents to copy into the new array.
|
||||
/// The container must not contain more than `capacity` elements.
|
||||
@available(SwiftStdlib 6.4, *)
|
||||
@_alwaysEmitIntoClient
|
||||
@inline(__always)
|
||||
public init<Source: BorrowingSequence<Element> & ~Copyable & ~Escapable>(
|
||||
@@ -143,6 +144,7 @@ extension RigidArray /*where Element: Copyable*/ {
|
||||
/// just enough capacity to store the contents.
|
||||
/// - contents: The container whose contents to copy into the new array.
|
||||
/// The container must not contain more than `capacity` elements.
|
||||
@available(SwiftStdlib 6.4, *)
|
||||
@_alwaysEmitIntoClient
|
||||
@inline(__always)
|
||||
public init<Source: BorrowingSequence<Element> & Sequence<Element>>(
|
||||
|
||||
@@ -405,6 +405,7 @@ extension RigidArray {
|
||||
}
|
||||
|
||||
#if compiler(>=6.4) && COLLECTIONS_UNSTABLE_CONTAINERS_PREVIEW
|
||||
@available(SwiftStdlib 6.4, *)
|
||||
@_alwaysEmitIntoClient
|
||||
internal mutating func _insertContainer<
|
||||
C: Container<Element> & ~Copyable & ~Escapable
|
||||
@@ -471,6 +472,7 @@ extension RigidArray {
|
||||
/// a valid index of the array.
|
||||
///
|
||||
/// - Complexity: O(`self.count` + `newElements.count`).
|
||||
@available(SwiftStdlib 6.4, *)
|
||||
@_alwaysEmitIntoClient
|
||||
@inline(__always)
|
||||
public mutating func insert<
|
||||
@@ -531,6 +533,7 @@ extension RigidArray {
|
||||
/// a valid index of the array.
|
||||
///
|
||||
/// - Complexity: O(`self.count` + `newElements.count`)
|
||||
@available(SwiftStdlib 6.4, *)
|
||||
@_alwaysEmitIntoClient
|
||||
@inline(__always)
|
||||
public mutating func insert<
|
||||
|
||||
@@ -580,6 +580,7 @@ extension RigidArray {
|
||||
}
|
||||
|
||||
#if compiler(>=6.4) && COLLECTIONS_UNSTABLE_CONTAINERS_PREVIEW
|
||||
@available(SwiftStdlib 6.4, *)
|
||||
@inlinable
|
||||
internal mutating func _replace<
|
||||
C: Container<Element> & ~Copyable & ~Escapable
|
||||
@@ -658,6 +659,7 @@ extension RigidArray {
|
||||
/// - newElements: The new elements to copy into the collection.
|
||||
///
|
||||
/// - Complexity: O(`self.count` + `newElements.count`)
|
||||
@available(SwiftStdlib 6.4, *)
|
||||
@inlinable
|
||||
@inline(__always)
|
||||
public mutating func replace<
|
||||
@@ -739,6 +741,7 @@ extension RigidArray {
|
||||
///
|
||||
/// - Complexity: O(*n* + *m*), where *n* is count of this array and
|
||||
/// *m* is the count of `newElements`.
|
||||
@available(SwiftStdlib 6.4, *)
|
||||
@inlinable
|
||||
@inline(__always)
|
||||
public mutating func replace<
|
||||
|
||||
Reference in new issue
Block a user