diff --git a/graph/labeled_graph.hpp b/graph/labeled_graph.hpp index 5b688b0..06935d7 100644 --- a/graph/labeled_graph.hpp +++ b/graph/labeled_graph.hpp @@ -223,6 +223,19 @@ namespace graph_detail { { return put_vertex_label(c, g, l, v, container_category(c)); } //@} + /** @name Remove Labeled Vertex */ + //@{ + template + void remove_labeled_vertex(Container& c, Graph& g, Label const& l) + { + typename Container::iterator c_it = c.find(l); + if (c_it != c.end()) { + boost::remove_vertex(c_it->second, g); + c.erase(c_it); + } + } + //@} + } // namespace detail struct labeled_graph_class_tag { }; @@ -385,7 +398,7 @@ public: /** Remove the vertex with the given label. */ void remove_vertex(Label const& l) - { return boost::remove_vertex(vertex(l), _graph); } + { return graph_detail::remove_labeled_vertex(_map, _graph, l); } /** Return a descriptor for the given label. */ vertex_descriptor vertex(Label const& l) const