dnadoba
(David Nadoba)
9
packed structs is a different concept to array of structs. Your example type as an array of structs would be [(Int8, Int32)] and struct of arrays would be ([Int8], [UInt32]).
Coming back to the original question, this is indeed something of interest and has come up in the past in a different context already:
We already have BitArray (referred to as bitmap in the linked post) in swift-collections and would now only need to implement the (partially initialized) unsafe buffer.
1 Like