Jump to content

  • Log In with Google      Sign In   
  • Create Account

#ActualBrother Bob

Posted 07 November 2012 - 04:51 PM

(btw I don't remember what the standard says about the state of an object after it has been moved, iirc it's just up to the move constructor or move operator to make sure the object is in a state where its destructor won't blow up once it goes out of scope)

Nothing happens to the object itself when it is moved. It is not the object that is moved, but it is the object's resources that have changed owners. So it is up to the move constructors/operators to ensure that the resources are transferred properly and that the object on the right hand side is still valid, although empty since its resources have been transferred to another object.

#2Brother Bob

Posted 07 November 2012 - 04:51 PM

(btw I don't remember what the standard says about the state of an object after it has been moved, iirc it's just up to the move constructor or move operator to make sure the object is in a state where its destructor won't blow up once it goes out of scope)

Nothing happens to the object itself when it is moved. It is not the object that is moved, but it is the object's resources that have changed owners. So it is up to the move constructors/operators to ensure that the resources are transferred properly and that the object on the right hand side is still valid, although empty since its resources have been transferred to another object.

#1Brother Bob

Posted 07 November 2012 - 04:50 PM

(btw I don't remember what the standard says about the state of an object after it has been moved, iirc it's just up to the move constructor or move operator to make sure the object is in a state where its destructor won't blow up once it goes out of scope)

Nothing happens to the object itself when it is moved. It is not the object that is moved, but it is the object's resources that have changed owners. So it is up to the move constructor/copy operator to ensure that the resources are transferred properly and that the object on the right hand side is still valid, although empty since its resources have been transferred to another object.

PARTNERS