Hacker News new | ask | show | jobs
by mtklein 616 days ago
Looks a little more like std::bit_cast? (Of course, there's a large overlap between the two.)
1 comments

TIL 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.