logoalt Hacker News

dalvrosayesterday at 1:28 PM2 repliesview on HN

Not sure what you mean, but std::move is one of the greatest tools in C++


Replies

pdpitoday at 1:03 PM

This is one case where Rust benefited from C++’s experience — move by default with opt-in clone/copy is IMO the better setup.

show 3 replies
bluGilltoday at 1:13 PM

std::move is a great tool when used correctly. However used incorrectly it makes code worse: more verbose and less performant. Since I have no idea how you are using it I can't comment on your experience. My experience is people (including me!) get it wrong fairly often. Fortunately tools can detect a lot of cases where you get it wrong.

show 1 reply