> > So looking into reinterpret_cast is not very relevant. > > You are using a reference of type unsigned int& to access something > that is not an unsigned int, that's the problem. > > The fact you used reinterpret_cast to create the reference is not > relevant, it's what you did with the reference after you created it > that is the problem. This is undefined in the same way, but doesn't use > reinterpret_cast: > > Flag f1; > void* vp = &f1; > *static_cast<unsigned int*>(vp) = 1; Ok, thanks. I think I get it now.