C++ 移动构造函数问题

a在这里是个消亡值,消亡值既属于泛左值,也属于右值
■网友
return statement (cppreference)If expression is an lvalue expression and the conditions for copy elision are met, or would be met, except that expression names a function parameter, then overload resolution to select the constructor to use for initialization of the returned value is performed twice: first as if expression were an rvalue expression (thus it may select the move constructor or a copy constructor taking reference to const), and if no suitable conversion is available, overload resolution is performed the second time, with lvalue expression (so it may select the copy constructor taking a reference to non-const).
■网友
右值引用出现后,你的那种情况默认是调用移动构造而不是拷贝构造


    推荐阅读