#include <iostream>
struct A
{
};
void f(A & _a)
{
std::cout << "lvalue called" << std::endl;
}
void f(A && _a)
{
std::cout << "rvalue called" << std::endl;
}
template <typename T>
class TD;
int main()
{
A&& a = A();
//TD<decltype(a)> b; // -> A &&
f(static_cast<A&&>(a));
f(a);
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgpzdHJ1Y3QgQQp7Cn07Cgp2b2lkIGYoQSAmIF9hKQp7CglzdGQ6OmNvdXQgPDwgImx2YWx1ZSBjYWxsZWQiIDw8IHN0ZDo6ZW5kbDsKfQoKdm9pZCBmKEEgJiYgX2EpCnsKCXN0ZDo6Y291dCA8PCAicnZhbHVlIGNhbGxlZCIgPDwgc3RkOjplbmRsOwp9Cgp0ZW1wbGF0ZSA8dHlwZW5hbWUgVD4KY2xhc3MgVEQ7CmludCBtYWluKCkKewoJQSYmIGEgPSBBKCk7CgoJLy9URDxkZWNsdHlwZShhKT4gYjsgICAgICAgICAvLyAtPiBBICYmCgkKCWYoc3RhdGljX2Nhc3Q8QSYmPihhKSk7CglmKGEpOwoJCgkKCXJldHVybiAwOwp9Cg==