I am new to c++11 and trying to understand to meaning of std::move and unique_ptr and wrote the following code, which I use std::move on a unique_ptr in two different ways:
void unique_ptr_plain_move() {
  unique_ptr<int> intptr(new int(10));
  unique_ptr<int> intptr2;
  printf("*intptr = %d\n", *intptr);
  intptr2 = std::move(intptr);
  printf("*intptr2 = %d\n", *intptr2);
  // as expected, crash here as we have already moved intptr's ownership.
  printf("*intptr = %d\n", *intptr);
}
/////////////////////////////////////////////
void function_call_move(unique_ptr<int>&& intptr) {
  printf("[func] *intptr = %d\n", *intptr);
}
void unique_ptr_function_call_move() {
  unique_ptr<int> intptr(new int(10));
  printf("*intptr = %d\n", *intptr);
  function_call_move(std::move(intptr));
  // this does not crash, intptr still has the ownership of its pointed instance ....
  printf("*intptr = %d\n", *intptr);
}
In unique_ptr_plain_move(), intptr2 takes the ownership of intptr after std::move and therefore we can no longer use intptr.  However, in unique_ptr_function_call_move(), when using std::move in a function call, intptr still have its ownership of its pointed instance.  Can I know what exactly happened when we pass a std::move(unique_ptr) to a function?  Thank you.
 
    