Hello,
I have a vector of shared_ptr<> I'd like to erase all those that are reset. This is how I do it. I call operator! which should return true if it's reset. Is it a good approach. There are so many ways to implement things and I'm trying to develop a sense of what is a better way of doing things. Thanks.
template<typename T>
void RemoveNulled(T& Vec)
{
// First remove from monitoring objects that no longer exist
Vec.erase(
std::remove_if(
Vec.begin(),
Vec.end(),
boost::bind(&T::value_type::operator!, _1)),
Vec.end());
}