Ticket #9493: boost_labeled_graph_fix.patch

File boost_labeled_graph_fix.patch, 1.1 KB (added by Adam Romanek <romanek.adam@…>, 9 years ago)
  • graph/labeled_graph.hpp

    diff --git a/graph/labeled_graph.hpp b/graph/labeled_graph.hpp
    index 5b688b0..06935d7 100644
    a b namespace graph_detail {  
    223223    { return put_vertex_label(c, g, l, v, container_category(c)); }
    224224    //@}
    225225
     226    /** @name Remove Labeled Vertex */
     227    //@{
     228    template <typename Container, typename Label, typename Graph>
     229    void remove_labeled_vertex(Container& c, Graph& g, Label const& l)
     230    {
     231      typename Container::iterator c_it = c.find(l);
     232      if (c_it != c.end()) {
     233        boost::remove_vertex(c_it->second, g);
     234        c.erase(c_it);
     235      }
     236    }
     237    //@}
     238
    226239} // namespace detail
    227240
    228241struct labeled_graph_class_tag { };
    public:  
    385398
    386399    /** Remove the vertex with the given label. */
    387400    void remove_vertex(Label const& l)
    388     { return boost::remove_vertex(vertex(l), _graph); }
     401    { return graph_detail::remove_labeled_vertex(_map, _graph, l); }
    389402
    390403    /** Return a descriptor for the given label. */
    391404    vertex_descriptor vertex(Label const& l) const