|
|
|
|
|
by fluffybucktsnek
20 days ago
|
|
I am not sure why either (I believe it is aliasing), here's an example: https://godbolt.org/z/9szhxoxrf From the code, we can already tell all elements have the same type, but the compiler is already adding checks. One of the options would be to convert the array of fat pointers into a fat slice. But now you have to enlarge the slice's vtable with all possible item operations, even if we don't use them often. Alternatively, use monomorphism. Or use both. |
|