Why isn't a named rvalue reference turned to const lvalue reference?

74 Views Asked by At

I'm wondering why, in the following example, the function func has this signature:

void func<int&>(int&)

I know that named rvalue references are treated like lvalue references. I'm wondering why they aren't const lvalue references? I was expecting to see void func<const int&>(const int&) as a signature of func function.

template<typename T>
void func(T&& t) {}

int main()
{
    int&& t = 5;
    func(t);
}
0

There are 0 best solutions below