#include <iostream>
#include <tuple>
#include <utility>
using namespace std;
tuple<int, double, const char *> f1()
{
return make_tuple(10, 22.33, "ABC");
}
pair<int, int> f2()
{
return make_pair(123, 456);
}
int main() {
int x;
double y;
const char *z;
tie(x, y, z) = f1();
cout << x << "," << y << "," << z << endl;
tuple_element<0, decltype(f2())>::type a;
tuple_element<1, decltype(f2())>::type b;
tie(a, b) = f2();
cout << a << "," << b << endl;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8dHVwbGU+CiNpbmNsdWRlIDx1dGlsaXR5PgoKdXNpbmcgbmFtZXNwYWNlIHN0ZDsKCnR1cGxlPGludCwgZG91YmxlLCBjb25zdCBjaGFyICo+IGYxKCkKewoJcmV0dXJuIG1ha2VfdHVwbGUoMTAsIDIyLjMzLCAiQUJDIik7Cn0KCnBhaXI8aW50LCBpbnQ+IGYyKCkKewoJcmV0dXJuIG1ha2VfcGFpcigxMjMsIDQ1Nik7Cn0KCmludCBtYWluKCkgewoJaW50IHg7Cglkb3VibGUgeTsKCWNvbnN0IGNoYXIgKno7Cgl0aWUoeCwgeSwgeikgPSBmMSgpOwoKCWNvdXQgPDwgeCA8PCAiLCIgPDwgeSA8PCAiLCIgPDwgeiA8PCBlbmRsOwoKCXR1cGxlX2VsZW1lbnQ8MCwgZGVjbHR5cGUoZjIoKSk+Ojp0eXBlIGE7Cgl0dXBsZV9lbGVtZW50PDEsIGRlY2x0eXBlKGYyKCkpPjo6dHlwZSBiOwoJdGllKGEsIGIpID0gZjIoKTsKCWNvdXQgPDwgYSA8PCAiLCIgPDwgYiA8PCBlbmRsOwp9Cg==