Boost logo

Boost Users :

From: Dmitry Bufistov (dmitry_at_[hidden])
Date: 2005-12-23 11:20:31


Hello Jeffrey,
I'm sorry for long silence, but better later then never,
Thank you very much for help!
Merry Christmas!
Best regards,
--Dmitry

> The way that I had to implement a template function to erase a graph
> was like:
> template<typename T1> inline void
> WorkFlow_Datum::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);
> }
> }
>
> My graph uses vectors, so I suspect that you need to use something
> similiar to avoid iterator instability and vertice descriptor
> instability. The later is way a reverse iterator was needed.
>


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net