Thank you, this is perfect

2007/11/13, Jeffrey Holle <jeffreyholle@bellsouth.net>:
Olivier Tournaire wrote:

> Any help would be appreciate.

This is the function that I came up with to erase a graph.

/*
  * Note the use of the reverse_iterator
  */
template<typename T1> void
EraseGraph(T1& g)
{
   typedef typename std::vector<typename
boost::graph_traits<T1>::vertex_descriptor> Vertices;
   Vertices vertices;
   typename boost::graph_traits<T1>::vertex_iterator vi,vi_end;
   for (boost::tie(vi,vi_end)=boost::vertices(g);vi!=vi_end;++vi)
     vertices.push_back(*vi);
   for (typename Vertices::reverse_iterator
iter=vertices.rbegin();iter!=vertices.rend();++iter) {
     boost::clear_vertex(*iter,g);
     boost::remove_vertex(*iter,g);
   }
}

_______________________________________________
Boost-users mailing list
Boost-users@lists.boost.org
http://lists.boost.org/mailman/listinfo.cgi/boost-users



--
Le temps des cerises reviendra. Dans l'immédiat, c'est le temps des noyaux. Courage.