Hacker News new | past | comments | ask | show | jobs | submit login

Could you go into some details into how it's wrong and how you interpret this statement? Prima facie, it does seem correct to me.



Prima facie: what does std::move look like it's trying to band-aid fix? copy operations?

They expanded the Rule of 3 to the Rule of 5 for a reason. The operations work together. Move semantics simply work as an optimization when you know the data you're taking in won't be needed anymore and you can more or less "snatch" the data (to put it overly broadly). If you can't do that, you take a slow path and just copy properties one by one.

Garbage collection? Well, besides these languages not having that, managed languages are making the exact same decisions under the hood when optimizing. if it knows a reference is being assigned but then goes out of scope, it can do similar move semantics to save on a copy.


I'm not even sure what feature std::move is supposed to be mitigating. Certainly not overloading, in any meaningful sense.




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: