Re:C++: Return value optimization vs. std::move
by seabee on Monday July 20, 2015 @12:02PM
(#9916941)
The 'object up the stack' is an rvalue reference. While we've successfully returned a reference into the caller's stack frame (RVO), the object it referred to has already been destroyed. That's why you see 'constructor, destructor' before 'move constructor'.
I'm struggling to see how it's an appropriate use of std::move in any case where you actually use the rvalue reference!
I'm struggling to see how it's an appropriate use of std::move in any case where you actually use the rvalue reference!