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]<
Try this:
template struct U1 { U1(); T v[2]; T& x; T& y; }; template U1::U1() :x(v[0]) ,y(v[1]) {} int main() { U1 data; data.x = 1; data.y = 2; }