by mgaunard · 1y ago · 0 comments
There are also GCC extensions to build other types that may alias.
In some cases you can use unions, but that, too, is very limited, and I am not sure it would let you do this particular case.
Also yes, that's the point of the C++ object model, only one type may exist in one location at a time.
Since usually different register banks are used for different types, having to copy makes sense.