3 ms·
Yes, it's safe to cast a reference to a raw pointer and a raw pointer to an address. It might have been nicer in some ways if the language had restricted that
by Rusky 2y ago
Yes, it's safe to cast a reference to a raw pointer and a raw pointer to an address.
It might have been nicer in some ways if the language had restricted that a bit more up front, but it would probably have taken some design work to do that while still supporting a lot of the low-level stuff people need to do.
- alkonaut 2y agoAn internal reference could only be cast to a relative memory offset. It’s not a global memory address in disguise like a normal reference. So the same casting rules wouldn't apply.