Comment by vlovich123
14 hours ago
aside from what others wrote, it’s also non local - whether std::move even does anything is dependent on the signature of foo - if foo takes it by const& you may think you’ve transferred ownership when it hasn’t actually happened.
That is static though, that `foo` takes its parameter by `const&` and will thus not move it is available to the compiler (or other tooling) at compile time.
The point of contention is whether that is always the case, or whether there are situations where moving from the parameter is a runtime decision.
Others have already answered that for you. I specifically said it’s non local which means it’s difficult for a human to reason about at the call site.