the.bay.news

How can I implement a {mutable}span property for my inline storage type?

Swift Forums
How can I implement a {mutable}span property for my inline storage type?
Currently, the platforms I'm targeting, do not support InlineArray. So, I wrote a simple type that stores some values inline: // Simplified, there are normally some other stuff here. struct InlineArraySize4<T> { var _storage: (T, T, T, T) init(repeating value: T) { self._storage = (value, value, value, value) } } Great, but one problem. I have no idea how to implement {mutable}span for my type. For heap storage, it's easy. Just pass the pointer to the span and you're done....

0 comments

Sign in to join the discussion — your thebay.events account works here.

No comments yet.