Lifetime extension, prvalues and xvalues
问题 Following the well accepted answer to this question Do rvalue references allow dangling references? It would seem that xvalues do not have their lifetime extended when assigned to a rvalue reference lvalue like in the question. However when I do this #include <iostream> using namespace std; class Something { public: Something() { cout << "Something()" << endl; } Something(const Something&) { cout << "Something(const Something&)" << endl; } Something(Something&&) { cout << "Something(Something