Comment by knorker

Comment by knorker 6 hours ago

0 replies

You should not be downvoted, which you appear to be. Your comparison is both correct and interesting.

Maybe you're being too verbose for your point, and it would help readers if you summarize and narrow the argument to:

In Rust a function signature can force a move to happen at call time (by being non-reference and not Copy), but in C++ a function taking rvalue reference (&&) only signals the callee that it's safe to move if you want, as it's not an lvalue in the caller.

It's an added bonus that Rust prevents reusing the named variable in the caller after the move-call, but it's not what people seem to be confused about.