#include <iostream>
using namespace std;
struct smth
{
template <int i> struct key_t {};
int x; int get(key_t<1>) { return this->x; }
double y; double get(key_t<2>) { return this->y; }
template <int i> auto get() -> decltype (this->get(key_t<i>())) { return this->get(key_t<i>()); }
};
int main()
{
smth s = {1, 2.5};
cout << s.x << ' ' << s.y << endl;
cout << s.get<1>() << ' ' << s.get<2>() << endl;
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgoKdXNpbmcgbmFtZXNwYWNlIHN0ZDsKCnN0cnVjdCBzbXRoCnsKCXRlbXBsYXRlIDxpbnQgaT4gc3RydWN0IGtleV90IHt9OwoJCglpbnQgeDsgaW50IGdldChrZXlfdDwxPikgeyByZXR1cm4gdGhpcy0+eDsgfQoJZG91YmxlIHk7IGRvdWJsZSBnZXQoa2V5X3Q8Mj4pIHsgcmV0dXJuIHRoaXMtPnk7IH0KCQoJdGVtcGxhdGUgPGludCBpPiBhdXRvIGdldCgpIC0+IGRlY2x0eXBlICh0aGlzLT5nZXQoa2V5X3Q8aT4oKSkpIHsgcmV0dXJuIHRoaXMtPmdldChrZXlfdDxpPigpKTsgfQp9OwoKaW50IG1haW4oKQp7CglzbXRoIHMgPSB7MSwgMi41fTsKCQoJY291dCA8PCBzLnggPDwgJyAnIDw8IHMueSA8PCBlbmRsOwoJY291dCA8PCBzLmdldDwxPigpIDw8ICcgJyA8PCBzLmdldDwyPigpIDw8IGVuZGw7CgkKCXJldHVybiAwOwp9