This is just an oddity I ran into and can't quite understand what's happening.
int main()
{
int i{ 5 };
void* v = &i;
int* t = reinterpret_cast<int*>(v);
int u = reinterpret_cast<int&>(v);
int i2 = *t;
}
t is correctly 5 and u is garbage.
What's going on?