On Mar 17, 2006, at 1:08 PM, Sean Kelly wrote:

here is the example code that works - XFlatGraph is a listS, listS adjacency_list.  Note if I replace the remove edge expression with remove_edge(*iter, _graph) the edge is intermittently not removed



    // Remove edges marked as simualtion only
    scheduled_for_removal.unique();
    for(std::list<XFlatView::edge_descriptor>::iterator iter = scheduled_for_removal.begin();
        iter != scheduled_for_removal.end();
        ++iter)
    {
        remove_edge(source(*iter, graph), target(*iter,graph), graph);
    }

Hmmm, this is dangerous. The problem is that once you delete the thing that "iter" points to, "iter" is invalidated and can no longer be used for traversal. To work around this, you should instead use remove_edge_if.

Doug