-
Notifications
You must be signed in to change notification settings - Fork 10.6k
[stdlib] Add ContiguousCollection #23616
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[stdlib] Add ContiguousCollection #23616
Conversation
//===----------------------------------------------------------------------===// | ||
|
||
/// A collection that supports access to its underlying contiguous storage. | ||
@available(iOS 9999, OSX 9999, tvOS 9999, watchOS 9999, *) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@available(iOS 9999, OSX 9999, tvOS 9999, watchOS 9999, *) | |
@available(macOS 9999, iOS 9999, tvOS 9999, watchOS 9999, *) |
OSX
=> macOS
(11 times) and in same order as rest of stdlib, for easier find and replace.
@available(iOS 9999, OSX 9999, tvOS 9999, watchOS 9999, *) | ||
public protocol ContiguousCollection: Collection | ||
where SubSequence: ContiguousCollection { | ||
/// Calls a closure with a pointer to the array's contiguous storage. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/// Calls a closure with a pointer to the array's contiguous storage. | |
/// Calls a closure with a pointer to contiguous storage. |
Remove: the array's
(also in the proposal).
@available(iOS 9999, OSX 9999, tvOS 9999, watchOS 9999, *) | ||
public protocol MutableContiguousCollection: ContiguousCollection, MutableCollection | ||
where SubSequence: MutableContiguousCollection { | ||
/// Calls the given closure with a pointer to the array's mutable contiguous |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/// Calls the given closure with a pointer to the array's mutable contiguous | |
/// Calls the given closure with a pointer to mutable contiguous |
Remove: the array's
(also in the proposal).
/// A collection that supports mutable access to its underlying contiguous | ||
/// storage. | ||
@available(iOS 9999, OSX 9999, tvOS 9999, watchOS 9999, *) | ||
public protocol MutableContiguousCollection: ContiguousCollection, MutableCollection |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wrap to 80 characters?
extension Slice: ContiguousCollection where Base: ContiguousCollection { } | ||
|
||
@available(iOS 9999, OSX 9999, tvOS 9999, watchOS 9999, *) | ||
extension Slice: MutableContiguousCollection where Base: MutableContiguousCollection { } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wrap to 80 characters?
SE-0256 has been rejected during formal Swift Evolution review. Closing this PR. |
Implementation for swiftlang/swift-evolution#990
Tests tk