Boost logo

Boost Users :

Subject: [Boost-users] [Q] does map.erase destroy shared_ptr ?
From: V S P (toreason_at_[hidden])
Date: 2009-03-30 13:05:23

I am storing database streams as associated string tag
std::map< std::string, boost::shared_ptr<otl_stream> >

once in a while I need to remove a stream based on the tag,

so I do

//find stream based on tag
//close stream s->close
//call map.erase

can I expect that once I call map erase
the destructor of the stream will get called?

(for some reason I do not see my trace statement of the destructor,
but the stream destruction are unfamiliar code to me.. so I may be
just doing something wrong).

thank you,

  V S P
-- - Faster than the air-speed velocity of an
                          unladen european swallow

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