There\'s no way to do something like this, in C++ is there?
union { { Scalar x, y; } Scalar v[2]; };
Where x == v[0]<
x == v[0]<
With C++11 you have anonymous unions and structs which just export their definitions to the enclosing scope, so you can do this:
typedef int Scalar; struct Vector { union { struct { Scalar x, y; }; Scalar v[2]; }; };