#include <iostream>
template <typename T, unsigned int D> struct Vec
{
static_assert(D && 0, "Invalid dimension for vector!");
};
template <typename T> struct Vec<T, 1> {union {T x, r;};};
template <typename T> struct Vec<T, 2> : Vec<T, 1> {union {T y, g;};};
template <typename T> struct Vec<T, 3> : Vec<T, 2> {union {T z, b;};};
template <typename T> struct Vec<T, 4> : Vec<T, 3> {union {T w, a;};};
int main()
{
Vec<float, 3> v;
v.x = 1;
v.y = 2;
v.z = 3;
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgoKdGVtcGxhdGUgPHR5cGVuYW1lIFQsIHVuc2lnbmVkIGludCBEPiBzdHJ1Y3QgVmVjCnsKCXN0YXRpY19hc3NlcnQoRCAmJiAwLCAiSW52YWxpZCBkaW1lbnNpb24gZm9yIHZlY3RvciEiKTsKfTsKCnRlbXBsYXRlIDx0eXBlbmFtZSBUPiBzdHJ1Y3QgVmVjPFQsIDE+ICAgICAgICAgICAgIHt1bmlvbiB7VCB4LCByO307fTsKdGVtcGxhdGUgPHR5cGVuYW1lIFQ+IHN0cnVjdCBWZWM8VCwgMj4gOiBWZWM8VCwgMT4ge3VuaW9uIHtUIHksIGc7fTt9Owp0ZW1wbGF0ZSA8dHlwZW5hbWUgVD4gc3RydWN0IFZlYzxULCAzPiA6IFZlYzxULCAyPiB7dW5pb24ge1QgeiwgYjt9O307CnRlbXBsYXRlIDx0eXBlbmFtZSBUPiBzdHJ1Y3QgVmVjPFQsIDQ+IDogVmVjPFQsIDM+IHt1bmlvbiB7VCB3LCBhO307fTsKCmludCBtYWluKCkKewoJVmVjPGZsb2F0LCAzPiB2OwoJdi54ID0gMTsKCXYueSA9IDI7Cgl2LnogPSAzOwoJCglyZXR1cm4gMDsKfQ==