Index: /trunk/boost/graph/named_graph.hpp =================================================================== --- /trunk/boost/graph/named_graph.hpp (revision 81772) +++ /trunk/boost/graph/named_graph.hpp (revision 82498) @@ -12,4 +12,5 @@ #include +#include #include #include @@ -20,7 +21,9 @@ #include #include // for boost::lookup_one_property +#include #include #include // for boost::make_tuple #include +#include #include #include @@ -254,5 +257,6 @@ /// Notify the named_graph that we are removing the given /// vertex. The name of the vertex will be removed from the mapping. - void removing_vertex(Vertex vertex); + template + void removing_vertex(Vertex vertex, VertexIterStability); /// Notify the named_graph that we are clearing the graph. @@ -309,6 +313,8 @@ template -inline void BGL_NAMED_GRAPH::removing_vertex(Vertex vertex) -{ +template +inline void BGL_NAMED_GRAPH::removing_vertex(Vertex vertex, VertexIterStability) +{ + BOOST_STATIC_ASSERT_MSG ((boost::is_base_of::value), "Named graphs cannot use vecS as vertex container and remove vertices; the lack of vertex descriptor stability (which iterator stability is a proxy for) means that the name -> vertex mapping would need to be completely rebuilt after each deletion. See https://svn.boost.org/trac/boost/ticket/7863 for more information and a test case."); typedef typename BGL_NAMED_GRAPH::vertex_name_type vertex_name_type; const vertex_name_type& vertex_name = extract_name(derived()[vertex]); @@ -487,5 +493,6 @@ /// Notify the named_graph that we are removing the given /// vertex. This is a no-op. - void removing_vertex(Vertex) { } + template + void removing_vertex(Vertex, VertexIterStability) { } /// Notify the named_graph that we are clearing the graph. This is a @@ -518,5 +525,6 @@ /// Notify the named_graph that we are removing the given /// vertex. This is a no-op. - void removing_vertex(Vertex) { } + template + void removing_vertex(Vertex, VertexIterStability) { } /// Notify the named_graph that we are clearing the graph. This is a Index: /trunk/boost/graph/detail/adjacency_list.hpp =================================================================== --- /trunk/boost/graph/detail/adjacency_list.hpp (revision 82052) +++ /trunk/boost/graph/detail/adjacency_list.hpp (revision 82498) @@ -18,4 +18,5 @@ #include #include +#include #include #include @@ -1904,5 +1905,5 @@ typedef typename Config::stored_vertex stored_vertex; Derived& g = static_cast(g_); - g.removing_vertex(u); + g.removing_vertex(u, boost::graph_detail::iterator_stability(g_.m_vertices)); stored_vertex* su = (stored_vertex*)u; g.m_vertices.erase(su->m_position); @@ -2204,5 +2205,5 @@ typedef typename Config::directed_category Cat; Graph& g = static_cast(g_); - g.removing_vertex(v); + g.removing_vertex(v, boost::graph_detail::iterator_stability(g_.m_vertices)); detail::remove_vertex_dispatch(g, v, Cat()); } Index: /trunk/boost/graph/distributed/named_graph.hpp =================================================================== --- /trunk/boost/graph/distributed/named_graph.hpp (revision 67706) +++ /trunk/boost/graph/distributed/named_graph.hpp (revision 82498) @@ -268,5 +268,6 @@ /// Notify the named_graph that we are removing the given /// vertex. This is a no-op. - void removing_vertex(Vertex) { } + template + void removing_vertex(Vertex, VertexIterStability) { } /// Notify the named_graph that we are clearing the graph @@ -1212,5 +1213,6 @@ /// Notify the named_graph that we are removing the given /// vertex. This is a no-op. - void removing_vertex(Vertex) { } + template + void removing_vertex(Vertex, VertexIterStability) { } /// Notify the named_graph that we are clearing the graph Index: /trunk/boost/graph/distributed/adjacency_list.hpp =================================================================== --- /trunk/boost/graph/distributed/adjacency_list.hpp (revision 77549) +++ /trunk/boost/graph/distributed/adjacency_list.hpp (revision 82498) @@ -38,4 +38,5 @@ #include #include +#include // Callbacks @@ -3428,5 +3429,5 @@ BOOST_ASSERT(u.owner == g.processor()); static_cast(static_cast(g)) - .removing_vertex(u); + .removing_vertex(u, boost::graph_detail::iterator_stability(g.base().m_vertices)); g.distribution().clear(); remove_vertex(u.local, g.base());