The key concept here is that std::move
by itself won't do any moving.
You can think of it as marking the object as a object that can be moved from.
The signature for function_call_move
is
void function_call_move( unique_ptr<int>&& ptr );
Which means it can only receive objects that could be moved from, formally known as rvalues, and bind that to a reference. The act of associating an rvalue to a rvalue reference don't invalidate the state of the original object either.
So, unless function_call_move
actually moves ptr
to another std::unique_ptr
inside it, your call to function_call_move(std::move(intptr));
won't invalidate intptr
and your usage will be perfectly fine.