当たり前のことだが、
typedef boost::shared_ptr IntPtr;
list l,l2;
int *pi = new int();
l.push_back(IntPtr(pi));
l2.push_back(IntPtr(pi));
list::iterator it;
list::iterator it2;
it = l.begin();
while(it != l.end())
{
it = l.erase(it);
}
っていうことをやってはいけないと思いますようだ。