News for hackers. Stuff that matters.
Re:C++: Return value optimization vs. std::move by a8da6b0c91d on Monday July 20, 2015 @11:47AM (#9916803)
It's definitely an appropriate use of std::move. When the local object destructs std::move has already ripped its guts out and put them in the object up the stack. The local object is just an empty shell at destruction.
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!

Re:C++: Return value optimization vs. std::move by nly on Monday July 20, 2015 @11:55AM (#9916869)
It's a safe, but inappropriate, use of std::move, which is kind of the point of the article ;)