Breaking strict aliasing when reinterpret_cast-ing pointer to an object vs directly casting the reference of the same object
There are multiple questions about the warning: dereferencing type-punned pointer might break strict-aliasing rules [-Wstrict-aliasing]
, from when adding compiler options -Wstrict-aliasing=2 -fstrict-aliasing
, and how to solve it.