Maybe the fix here is to fix things so that Array<Optional<SomeType>>
keeps the optional flags in a side table instead of with the data, unless SomeType
has extra inhabitants. That would be more efficient in the general case anyway, and the only problem is if we've somehow guaranteed the memory layout of Array<Optional<SomeType>>
2 Likes