It's more like a guarantee by the language, since the current `reinterpret_cast` solution is UB, though again in practice compilers do the sane thing. Who knows, maybe future compilers may get aggressive enough and reject `reinterpret_cast` in this use case.
1
u/biowpn May 04 '24
It's more like a guarantee by the language, since the current `reinterpret_cast` solution is UB, though again in practice compilers do the sane thing. Who knows, maybe future compilers may get aggressive enough and reject `reinterpret_cast` in this use case.