Friday, December 3, 2010


When an auto_ptr is copied or assigned, the pointer held in the source auto_ptr is set to NULL.

This is the one of the reasons that the auto_ptr does not have value semantics. By changing the source object on assignments and copies causes strange behavior when temporaries are created.

No comments:

Post a Comment