Reinterpret cast of void * didn’t do what I thought it would
I am trying to create a reference to a struct in an arbitrary block of memory pointed to by a void pointer. But I cant seem to work it out!
Clarification on Undefined Behavior Surrounding reinterpret_cast
I’ve done a lot of reading recently on reinterpret_cast
as I want to ensure I’m using it correctly and not accidentally invoking undefined behavior. I feel like cppreference and this great writeup on strict aliasing has me 95% of the way there, but I wanted some clarification on my understanding of what is, and is not UB.