Delete a STL vector of pointers to objects

by ixmx


vector<Node *> _nodes;
 
static bool delete_node(Node * p_node)
{
    delete p_node;
    return true;
}
 
void delete_all()
{
    remove_if(_nodes.begin(),_nodes.end(),delete_node);
}
 
Advertisements