1. Lvalue and Rvalue: C + + for left and right values there is no standard definition, but there is a widely accepted saying: can take the address, the name, non-temporary is the left value, can not take the address, no name, temporary is the right value. The immediate number is visible, the value returned by the function is the right value, and not the anonymous object (including the variable), the reference returned by the function, the const object, and so on are all lvalue values. In essence, creation and destruction are controlled by the compiler behind the scenes, and programmers can only ensure that the right value (including the immediate number) is valid in the bank's code, and that the user creates, through the scope rules, the lifetime of the left value (including the reference to the local variable returned by the function and the const object), for example: int & foo () {int tmp; return tmp;} int fooo () {int tmp; RET
1. Analysis of rvalue reference, transfer semantics and perfect forwarding in c++11
Introduction: Moving semantics is an important concept for c++11, and I have been indefinitely this concept for a long time. Recently flipped data feeling suddenly enlightened, so by the way to record the c++11 in the right-hand reference, transfer semantics and perfect forwarding, convenient for everyone to access the reference
"Related question and answer recommendation":
C + +-is there a const rvalue reference?
C + +-why the return value of Std::move () can be assigned to an rvalue reference
Overloaded operators-operator overloading in C + + requires multiple duplicate versions (reference and rvalue references), and there are no methods to simplify
C + +-template functions that accept rvalue reference parameters
C + +-what does "clobber the Lvalue" mean?