I have a 3D vector class. The private variables are defined:
union { struct { double x; double y; double z; }; double data[3]; };
In implementing operator==, which is faster?
return this->x == v.x && this->y == v.y && this->z == v.z;
OR
return memcmp(this->data, v.data) == 0;