#include <type_traits>
int& get_i(){ static int i = 5; return i; }
int main(){
auto i1 = get_i(); // copy
decltype(get_i()) i2 = get_i(); // reference
static_assert(std::is_same<decltype(i1), int>::value, "wut");
static_assert(std::is_same<decltype(i2), int&>::value, "huh");
}
I2luY2x1ZGUgPHR5cGVfdHJhaXRzPgoKaW50JiBnZXRfaSgpeyBzdGF0aWMgaW50IGkgPSA1OyByZXR1cm4gaTsgfQoKaW50IG1haW4oKXsKICBhdXRvIGkxID0gZ2V0X2koKTsgLy8gY29weQogIGRlY2x0eXBlKGdldF9pKCkpIGkyID0gZ2V0X2koKTsgLy8gcmVmZXJlbmNlCiAgc3RhdGljX2Fzc2VydChzdGQ6OmlzX3NhbWU8ZGVjbHR5cGUoaTEpLCBpbnQ+Ojp2YWx1ZSwgInd1dCIpOwogIHN0YXRpY19hc3NlcnQoc3RkOjppc19zYW1lPGRlY2x0eXBlKGkyKSwgaW50Jj46OnZhbHVlLCAiaHVoIik7Cn0K