@lpereira no STL container ever calls delete on a pointer. The pointer is indeed destroyed because it goes out of scope, but default destructor of a pointer won't free the memory it is pointing to. :)

If we don't want to call delete, we would need a `std::map' of `scoped_ptr`.

From /usr/include/c++/4.7/bits/stl_map.h:

"This function erases all the elements located by the given key from a %map. Note that this function only erases the element, and that if the element is itself a pointer, the pointed-to memory is not touched in any way.  Managing the pointer is the user's responsibility."