If I have an union
union Bytes {
std::uint16_t bytes;
std::array<std::uint8_t, 2> split_bytes;
};
and I use it like this
int main(){
auto bytes = Bytes{0xFF'EE};
// do something with bytes.split_bytes[0] and bytes.split_bytes[1]
}
Assuming the target machine is little endian, is my usage well-defined behavior?