4 ms·
Nah it's all good! This is a pretty common thing, and sometimes comes in an alternate form ("can't you just Arc all the things?") You can cast them to a refere
by steveklabnik 6y ago
Nah it's all good! This is a pretty common thing, and sometimes comes in an alternate form ("can't you just Arc all the things?")
You can cast them to a reference. The issue is, the tricky UB happens at this exact boundary. If you're only using references, then the compiler has your back. If you're only using raw pointers, then there are no aliasing issues, so you're good. The hardest part is exactly the boundary between the two. Staying in one world or the other is much easier than going back and forth.