I read this question and got extremely confused on what I have to do with my code. If my reading is correct, my code below is undefined according to the current standard. Below is everything I need, and I really cannot find a better way to do this. Using left shift with OR is definitely not what I want. Is it just fine to leave it this way?
EDIT: And yes I am reading n
after setting the values of rbg
and not n.
union Pixel {
unsigned char rgb[4];
uint32_t n;
Pixel():
n(0) {}
};