mirror of
https://github.com/apple/swift-collections
synced 2026-11-30 05:18:44 +00:00
[BasicContainers] RigidArray, UniqueArray: Gather all public initializers into the same source file
This commit is contained in:
4 files changed
+47
-30
No files matched your search
@@ -16,6 +16,21 @@ import ContainersPreview
|
||||
|
||||
#if compiler(>=6.2)
|
||||
|
||||
@available(SwiftStdlib 5.0, *)
|
||||
extension UniqueArray where Element: ~Copyable {
|
||||
/// Initializes a new unique array with no elements.
|
||||
@inlinable
|
||||
public init() {
|
||||
_storage = .init(capacity: 0)
|
||||
}
|
||||
|
||||
/// Initializes a new unique array with the specified capacity and no elements.
|
||||
@inlinable
|
||||
public init(capacity: Int) {
|
||||
_storage = .init(capacity: capacity)
|
||||
}
|
||||
}
|
||||
|
||||
@available(SwiftStdlib 5.0, *)
|
||||
extension UniqueArray where Element: ~Copyable {
|
||||
/// Creates a new array with the specified capacity, directly initializing
|
||||
|
||||
Reference in new issue
Block a user