ここで変態的なのを出してみる。

struct bar
{
foo x,y,z;
foo& operator[](int i)
{
static foo bar::* hage[] = {&bar::x,&bar::y,&bar::z};
return this->*(hage[i]);
}
};