#include <iostream>
using namespace std;
int main()
{
int a = 4, b = 5;
cout << "Before assignment: a: " << a << ", b: " << b << endl;
pair<int&, int&> ba(b, a);
ba = make_pair(a, b); // <===: (b, a) = (a, b)
cout << "After assignment : a: " << a << ", b: " << b << endl;
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgp1c2luZyBuYW1lc3BhY2Ugc3RkOwoKaW50IG1haW4oKQp7CiAgaW50IGEgPSA0LCBiID0gNTsKICBjb3V0IDw8ICJCZWZvcmUgYXNzaWdubWVudDogYTogIiA8PCBhIDw8ICIsIGI6ICIgPDwgYiA8PCBlbmRsOwogIHBhaXI8aW50JiwgaW50Jj4gYmEoYiwgYSk7CiAgYmEgPSBtYWtlX3BhaXIoYSwgYik7IC8vIDw9PT06IChiLCBhKSA9IChhLCBiKQogIGNvdXQgPDwgIkFmdGVyIGFzc2lnbm1lbnQgOiBhOiAiIDw8IGEgPDwgIiwgYjogIiA8PCBiIDw8IGVuZGw7CiAgcmV0dXJuIDA7Cn0=