c++: function lvalue or rvalue
问题 I just started learning about rvalue references in c++11 by reading this page, but I got stuck into the very first page. Here is the code I took from that page. int& foo(); foo() = 42; // ok, foo() is an lvalue int* p1 = &foo(); // ok, foo() is an lvalue int foobar(); j = foobar(); // ok, foobar() is an rvalue int* p2 = &foobar(); // error, cannot take the address of an rvalue why is foo() an lvalue? is it because foo() returns int& which is basically an lvalue? why is foobar() an rvalue? is