| ▲ | ben-schaaf 9 hours ago | |
No, it is not statically knowable if it is actually moved.
Does not move `arg`. It's fairly easy to write code that assumes `std::move` moves the value, but that can lead to bugs. For example:
The expectation is that `some_other_function` is always called with `{ 2 }`, but this will only happen if `some_function` actually moves `a`. | ||
| ▲ | adrianN 5 hours ago | parent [-] | |
Is pushing to a moved-from vector even legal? I thought in general the only guarantee you have after a move is that is save to destruct the object. | ||