summaryrefslogtreecommitdiffstats
path: root/source/l/boost/changeset_82498.diff
blob: 6b7a9a705f149e88a025894f631e49235e190cb5 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
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 <boost/config.hpp>
+#include <boost/static_assert.hpp>
 #include <boost/functional/hash.hpp>
 #include <boost/graph/graph_traits.hpp>
@@ -20,7 +21,9 @@
 #include <boost/optional.hpp>
 #include <boost/pending/property.hpp> // for boost::lookup_one_property
+#include <boost/pending/container_traits.hpp>
 #include <boost/throw_exception.hpp>
 #include <boost/tuple/tuple.hpp> // for boost::make_tuple
 #include <boost/type_traits/is_same.hpp>
+#include <boost/type_traits/is_base_of.hpp>
 #include <boost/type_traits/remove_cv.hpp>
 #include <boost/type_traits/remove_reference.hpp>
@@ -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 <typename VertexIterStability>
+  void removing_vertex(Vertex vertex, VertexIterStability);
 
   /// Notify the named_graph that we are clearing the graph.
@@ -309,6 +313,8 @@
 
 template<BGL_NAMED_GRAPH_PARAMS>
-inline void BGL_NAMED_GRAPH::removing_vertex(Vertex vertex)
-{
+template<typename VertexIterStability>
+inline void BGL_NAMED_GRAPH::removing_vertex(Vertex vertex, VertexIterStability)
+{
+  BOOST_STATIC_ASSERT_MSG ((boost::is_base_of<boost::graph_detail::stable_tag, VertexIterStability>::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 <typename VertexIterStability>
+  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 <typename VertexIterStability>
+  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 <boost/operators.hpp>
 #include <boost/property_map/property_map.hpp>
+#include <boost/pending/container_traits.hpp>
 #include <boost/range/irange.hpp>
 #include <boost/graph/graph_traits.hpp>
@@ -1904,5 +1905,5 @@
       typedef typename Config::stored_vertex stored_vertex;
       Derived& g = static_cast<Derived&>(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<Graph&>(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 <typename VertexIterStability>
+  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 <typename VertexIterStability>
+  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 <boost/graph/distributed/selector.hpp>
 #include <boost/graph/parallel/process_group.hpp>
+#include <boost/pending/container_traits.hpp>
 
 // Callbacks
@@ -3428,5 +3429,5 @@
     BOOST_ASSERT(u.owner == g.processor());
     static_cast<named_graph_mixin&>(static_cast<graph_type&>(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());