← Back to context

Comment by tsimionescu

1 month ago

People were very right to downvote me, as I was being fairly certain, but wrong.

The truth is that when you call a function which takes an r-value reference, it is NOT determined statically if the value you passed to the function is moved-from or not after the function call ends. This is ultimately similar to passing a value by non-const reference to a function - the function may or may not modify the value, so it may or may not be safe to use it the same way afterwards.