$include_dir="/home/hyper-archives/boost-users/include"; include("$include_dir/msg-header.inc") ?>
Subject: [Boost-users] shared_ptr and std::set::erase
From: Javier Jerónimo (jjeronimo_at_[hidden])
Date: 2008-10-09 06:46:49
Hello,
I have:
std::set< boost::shared_ptr< A > > m_set;
and when I try to do:
m_set.erase( somesharedptr );
the shared_ptr is not removed from the set. There is already a shared_ptr
object pointing to the same A object inside the set.
I think it's because the definition of "shared_ptr<>::operator<" and its use
in std::set<>::erase.
What's the correct way of using a shared_ptr inside a set?
Thanks.