Jump to content

  • Log In with Google      Sign In   
  • Create Account


#ActualMussi

Posted 03 February 2014 - 08:59 AM

That depends on the implementation of the move constructor and the data you're trying to access. The variable a has not been 'moved', it still resides in the same memory location occupying the same space. The variable that's been constructed in the vector can steal contents from a. If for example a holds a pointer to an array, this pointer could be copied and then set to null for a, accessing the pointer through a would then result in a nullpointer error.


#1Mussi

Posted 03 February 2014 - 06:52 AM

That depends on the implementation of of the move constructor and the data you're trying to access. The variable a has not been 'moved', it still resides that the same memory location occupying the same space. The variable that's been constructed in the vector can steal contents from a. If for example a holds a pointer to an array, this pointer could be copied and then set to null for a, accessing the pointer through a would then result in a nullpointer error.


PARTNERS