Assigning Rvalue returned from function to another Rvalue
问题 class Test { public: int n1; }; Test func() { return Test(); } int main() { func() = Test(); } This doesn't make sense to me. How and why is this allowed? Is it undefined behavior? If a function returns an rvalue, then how is it possible to set an rvalue to another rvalue? If I tried this with any primitive types, it would give me an error like I expect. I know that lvalues are a place in memory, so is the function creating a temporary lvalue (rvalue?) and assigning it to another lvalue? Can