I have a really simple function definition here:
void testRvalue(int&& r)
{
printf("rvalue ref is called\n");
testRvalue(r); // this line gives "no known conversion from 'int' to 'int &&' for 1st argument"
}
I mean inside this function, what is the type of r? Isn't it int&& (the parameter is int&& r so how come r is not of type int&&?) If so why can't I pass this r to this function itself, which takes a int&& type as parameter?
What is the type of r exactly? int&& or int? If int, why?