2 ms·
But if I understand it right, auto_ptr assignment didn't actually copy the pointer, but instead moved it to a new variable and quietly made the original variabl
by kennu 4mo ago
But if I understand it right, auto_ptr assignment didn't actually copy the pointer, but instead moved it to a new variable and quietly made the original variable null? And unique_ptr made this operation require an explicit move() call, because the assignment-only style caused too many null pointer bugs.
I'm just curious about this for historical interest.
- oezi 4mo agoYes, it was a design decision of the auto_ptr to have this move semantics and it worked very nicely for us because we used for instance to pass progress monitors down the stack.