I posted this answer: https://stackoverflow.com/a/28459180/2642059 Which contains the following code:
void foo(string&& bar){
string* temp = &
The expression bar is an lvalue. But it is not an "rvalue reference to string". The expression bar is an lvalue reference. You can verify it by adding the following line in foo():
cout << is_lvalue_reference::value << endl; // prints "1"
But I agree with the rest of the explanation of Angew.
An rvalue reference, after it has been bound to an rvalue, is an lvalue reference. Actually it is not just for function parameters:
string&& a = "some string";
string&& b = a; // ERROR: it does not compile because a is not an rvalue
If you can perform any operation on an rvalue reference that you can on an lvalue reference what is the point in differentiating between the two with the "&&" instead of just an "&"?
An rvalue reference allows us to do some "lvalue operations" before the rvalue expires.