News for hackers. Stuff that matters.
Re:But I was helping the compiler by knorker on Friday August 21, 2020 @06:28PM (#24239532)
In this case though the problem was trying to use a feature OP didn't understand.

The straightforward naive code is also the best code, here. So it's not an example of what you describe. In fact at least on stl containers, and your own classes with such members, move semantics "just works". Rebuild the same c++98 code with c++11 and it just skips needless copies as part of the language, not implementation.

And it's not about second-guessing. The confusion here is not about the compiler implementation. It's about the language.

There are no comments on this comment yet.