Oh yeah, I just remembered that Foundation already has a ContiguousBytes
protocol.
The reason why I think this is on-topic is because we appear to have several, disjoint abstractions for expressing contiguous storage. How should we teach this?
- For 3rd-party types: which protocols/customisation points should you implement?
- For 3rd-party algorithms: if you can benefit from contiguous storage access, what should your generic/existential constraints be?
I'm not sure how to answer those questions, but I think ContiguousBytes
is too fundamental to live in Foundation. It is very likely to be duplicated by the standard library at some point.