Boost logo

Boost Users :

Subject: Re: [Boost-users] how to delete references to objects from a container...
From: Igor R (boost.lists_at_[hidden])
Date: 2009-12-09 09:29:58

>  If I store the shared_ptr, I want to know how to delete this explicitly from the stl container.
> According to my understanding shared_ptrs cannot be 'delete'd.  So, how to achieve this...?

You can delete shared_ptr from a container, just like you delete any
element, using contaners member functions (like erase(), pop_front()
You cannot delete the *pointee* of the shared_ptr, because it might be
shared. But if there's no other copy of the shared_ptr that you delete
from your container, the pointee will be deleted as well.

Boost-users list run by williamkempf at, kalb at, bjorn.karlsson at, gregod at, wekempf at