M
molw5.iwg
Recently I've been using C++11 enumerations to provide a byte pointer with
stronger strict-aliasing properties. Specifically, I've been using the
definition:
enum byte : uint8_t {};
My reading of the strict-aliasing rules supports the behaviour modern compilers
exhibit in this regard; specifically, byte* aliases only other byte pointers and
raw character points. I'm looking for a second opinion here with respect to the
strict-aliasing rules – additionally, I'd like to know if I'm implicitly relying
on any undefined or implementation-specific behaviour here I may have overlooked.
Thanks in advance,
-molw5
stronger strict-aliasing properties. Specifically, I've been using the
definition:
enum byte : uint8_t {};
My reading of the strict-aliasing rules supports the behaviour modern compilers
exhibit in this regard; specifically, byte* aliases only other byte pointers and
raw character points. I'm looking for a second opinion here with respect to the
strict-aliasing rules – additionally, I'd like to know if I'm implicitly relying
on any undefined or implementation-specific behaviour here I may have overlooked.
Thanks in advance,
-molw5