#include <utility>
#include <iostream>
using namespace std;
template< class T >
T &
operator->*( pair<T,T> &l, bool r )
{ return r? l.second : l.first; }
template< class T >
T & operator->*( bool l, pair<T,T> &r ) { return r->*l; }
int main() {
pair<int, int> y( 5, 6 );
y->*(0) = 7;
y->*0->*y = 8; // evaluates to 7->*y = y.second
cerr << y.first << " " << y.second << endl;
}
I2luY2x1ZGUgPHV0aWxpdHk+CiNpbmNsdWRlIDxpb3N0cmVhbT4KdXNpbmcgbmFtZXNwYWNlIHN0ZDsKCnRlbXBsYXRlPCBjbGFzcyBUID4KVCAmCm9wZXJhdG9yLT4qKCBwYWlyPFQsVD4gJmwsIGJvb2wgciApCiAgICB7IHJldHVybiByPyBsLnNlY29uZCA6IGwuZmlyc3Q7IH0KCnRlbXBsYXRlPCBjbGFzcyBUID4KIFQgJiBvcGVyYXRvci0+KiggYm9vbCBsLCBwYWlyPFQsVD4gJnIgKSB7IHJldHVybiByLT4qbDsgfQoKaW50IG1haW4oKSB7CiAgICAgICAgcGFpcjxpbnQsIGludD4geSggNSwgNiApOwogICAgICAgIHktPiooMCkgPSA3OwogICAgICAgIHktPiowLT4qeSA9IDg7IC8vIGV2YWx1YXRlcyB0byA3LT4qeSA9IHkuc2Vjb25kCiAgICAgICAgY2VyciA8PCB5LmZpcnN0IDw8ICIgIiA8PCB5LnNlY29uZCA8PCBlbmRsOwp9