Skip to content

[SR-3631] Introduce ContiguouslyStored protocol and kill ArraySlice type #46216

@dabrahams

Description

@dabrahams
Previous ID SR-3631
Radar rdar://problem/30541077
Original Reporter @dabrahams
Type Improvement

Attachment: Download

Additional Detail from JIRA
Votes 0
Component/s Standard Library
Labels Improvement, AffectsABI, StarterProposal
Assignee None
Priority Medium

md5: 0b822da3966dafcaf6527038fc805b6a

relates to:

  • SR-3633 Support for segmented data structures
  • SR-3087 No way to arbitrarily initialise an Array's storage

Issue Description:

Sketch:

protocol ContiguouslyStored : RandomAccessCollection {
  func withUnsafeBufferPointer<R>(...) -> R
  mutating func withUnsafeMutableBufferPointer<R>(...) -> R
}

extension Slice : ContiguouslyStored where Base : ContiguouslyStored {
  func withUnsafeBufferPointer<R>(...) -> R { ... }
  mutating func withUnsafeMutableBufferPointer<R>(...) -> R { ... }
}

typealias ArraySlice<T> = Slice<Array<T>>

(This is related to https://bugs.swift.org/browse/SR-3633)

Metadata

Metadata

Assignees

No one assigned

    Labels

    affects ABIFlag: Affects ABIgood first issueGood for newcomersimprovementstandard libraryArea: Standard library umbrellaswift evolution implementedFlag → feature: A feature that was approved through the Swift evolution process and implemented

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions