[swift-evolution] [Pitch] Normalize Slice Types for Unsafe Buffers

Jordan Rose jordan_rose at apple.com
Thu Dec 8 18:35:05 CST 2016


> On Dec 8, 2016, at 16:22, Andrew Trick via swift-evolution <swift-evolution at swift.org> wrote:
> 
> In practice, it needs to be able to interoperate with [UInt8] and be interchangeable in the same generic context.
> 
> e.g. `byteBuffer += rawBuffer[payloadIndex..<endIndex]` is typical.
> 
> I think Sequence is sufficient for that purpose.

Um, Sequence doesn’t have a subscript (or indexes). Sequences are single-pass. So if this is important, it needs to stay a Collection.

Jordan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20161208/56ba2515/attachment.html>


More information about the swift-evolution mailing list