Let's say I have a constructor like this:
MyColor(uint8 vec[]) {
r = vec[0];
g = vec[1];
b = vec[2];
a = vec[3];
}
But I call it like this (3 elements instead of 4):
uint8 tmp[] = {1,2,3};
MyColor c(tmp);
But now vec[3]
is undefined... is it safe to assign this value to a
? If not, there's no nice workaround to check if vec[3]
is set is there?