With the addition of NovelRT::Utilities::Misc::BitCast type punning can be expressed in a more easy to understand way. It has been used in a few places so far, but might be able to be used in more places to better express what is going on.
Something to watch out for is that when bitcasting an instance through pointers, such as this, you should take care and see if you should de-reference a variable before passing it as an argument. As some types have the same size as pointers, you might end up transforming the pointer instead of it's value.
With the addition of
NovelRT::Utilities::Misc::BitCast
type punning can be expressed in a more easy to understand way. It has been used in a few places so far, but might be able to be used in more places to better express what is going on.Something to watch out for is that when bitcasting an instance through pointers, such as
this
, you should take care and see if you should de-reference a variable before passing it as an argument. As some types have the same size as pointers, you might end up transforming the pointer instead of it's value.Example
Taking the following example:
Would become: