
On 18 March 2011 01:40, Sid Sacek <ssacek@securewatch24.com> wrote:
I think it's simply stating an intention; the intention being that the current shared pointer is no longer interesting in the shared object; who cares if the shared object gets deleted under the covers.
Suppose the shared object holds an open file descriptor or a lock on a mutex. It would be nice if the file actually got closed or the lock got released.
This is the mentality that one needs to have in a garbage-collected environment, since you get the same exact effect when you set a reference to null.
The single most important feature of C++ is that destruction of objects happen at well defined times. GC in C++ would separate destruction of objects from memory reclamation. Other GC languages have a harder time reclaiming resources other than memory because they don't or can't separate out these two distinct phases. -- Nevin ":-)" Liber <mailto:nevin@eviloverlord.com> (847) 691-1404