Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r53133 - trunk/boost/graph
From: asutton_at_[hidden]
Date: 2009-05-20 12:05:08


Author: asutton
Date: 2009-05-20 12:05:05 EDT (Wed, 20 May 2009)
New Revision: 53133
URL: http://svn.boost.org/trac/boost/changeset/53133

Log:
Whitespace and commenting. Added mutability traits to subgraph.

Text files modified:
   trunk/boost/graph/graph_mutability_traits.hpp | 2 +-
   trunk/boost/graph/labeled_graph.hpp | 4 +++-
   trunk/boost/graph/subgraph.hpp | 15 ++++++++++++---
   3 files changed, 16 insertions(+), 5 deletions(-)

Modified: trunk/boost/graph/graph_mutability_traits.hpp
==============================================================================
--- trunk/boost/graph/graph_mutability_traits.hpp (original)
+++ trunk/boost/graph/graph_mutability_traits.hpp 2009-05-20 12:05:05 EDT (Wed, 20 May 2009)
@@ -240,4 +240,4 @@
 
 } // namespace boost
 
-#endif
\ No newline at end of file
+#endif

Modified: trunk/boost/graph/labeled_graph.hpp
==============================================================================
--- trunk/boost/graph/labeled_graph.hpp (original)
+++ trunk/boost/graph/labeled_graph.hpp 2009-05-20 12:05:05 EDT (Wed, 20 May 2009)
@@ -775,7 +775,9 @@
 
 /** @name Labeled Mutable Graph
  * The labeled mutable graph hides the add_ and remove_ vertex functions from
- * the mutable graph concept.
+ * the mutable graph concept. Note that the remove_vertex is hidden because
+ * removing the vertex without its key could leave a dangling reference in
+ * the map.
  */
 //@{
 template <LABELED_GRAPH_PARAMS>

Modified: trunk/boost/graph/subgraph.hpp
==============================================================================
--- trunk/boost/graph/subgraph.hpp (original)
+++ trunk/boost/graph/subgraph.hpp 2009-05-20 12:05:05 EDT (Wed, 20 May 2009)
@@ -237,7 +237,7 @@
     template<typename Descriptor>
     typename graph::detail::bundled_result<Graph, Descriptor>::type&
     operator[](Descriptor x)
- {
+ {
       if (m_parent == 0) return m_graph[x];
       else return root().m_graph[local_to_global(x)];
     }
@@ -245,7 +245,7 @@
     template<typename Descriptor>
     typename graph::detail::bundled_result<Graph, Descriptor>::type const&
     operator[](Descriptor x) const
- {
+ {
       if (m_parent == 0) return m_graph[x];
       else return root().m_graph[local_to_global(x)];
     }
@@ -254,7 +254,7 @@
     // private:
     typedef typename property_map<Graph, edge_index_t>::type EdgeIndexMap;
     typedef typename property_traits<EdgeIndexMap>::value_type edge_index_type;
- BOOST_STATIC_ASSERT((!is_same<edge_index_type,
+ BOOST_STATIC_ASSERT((!is_same<edge_index_type,
                         boost::detail::error_property_not_found>::value));
 
     Graph m_graph;
@@ -885,6 +885,15 @@
     return vertex(n, g.m_graph);
   }
 
+ //===========================================================================
+ // Mutability Traits
+ // Just pull the mutability traits form the underlying graph. Note that this
+ // will probably fail (badly) for labeled graphs.
+ template <typename G>
+ struct graph_mutability_traits< subgraph<G> > {
+ typedef typename graph_mutability_traits<G>::category category;
+ };
+
 } // namespace boost
 
 #endif // BOOST_SUBGRAPH_HPP


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk