3 ms·
Looks a little more like std::bit_cast? (Of course, there's a large overlap between the two.)
by mtklein 2y ago
Looks a little more like std::bit_cast? (Of course, there's a large overlap between the two.)
- steveklabnik 2y agoTIL about bit_cast. You may be correct, checking out its docs. The StackOverflow answer I just read comparing the two suggests bit_cast is a library function, transmute is an intrinsic. But transmute is const, and reinterpret_cast isn’t. So on some level it’s a mix of the two. Most important thing is that it’s closer to this kind of cast than a normal one.