-
Notifications
You must be signed in to change notification settings - Fork 10.6k
Closed
Labels
featureA feature request or implementationA feature request or implementationstandard libraryArea: Standard library umbrellaArea: Standard library umbrella
Description
Previous ID | SR-11957 |
Radar | rdar://58090587 |
Original Reporter | @stephentyrone |
Type | New Feature |
Status | Resolved |
Resolution | Done |
Additional Detail from JIRA
Votes | 0 |
Component/s | Standard Library |
Labels | New Feature |
Assignee | @lorentey |
Priority | Medium |
md5: 1e0512ad7793abdadd029d3398408f86
Issue Description:
Slice does not implement withContiguous[Mutable]StorageIfAvailable
, which means it falls to the default implementation which, unconditionally nil
s out, even when Base
does provide a custom implementation.
This is most noticeable with Unsafe[Mutable]BufferPointer
:
var a = UnsafeMutableBufferPointer<Int>.allocate(capacity: 4)
a[1...].withContiguousStorageIfAvailable { print($0) } // does not print
Providing a good implementation on Slice is somewhat tricky because we are lacking constraints on the index type of Base, but it would be nice to improve this.
Metadata
Metadata
Assignees
Labels
featureA feature request or implementationA feature request or implementationstandard libraryArea: Standard library umbrellaArea: Standard library umbrella