Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r66907 - trunk/boost/graph
From: jewillco_at_[hidden]
Date: 2010-11-30 13:16:29


Author: jewillco
Date: 2010-11-30 13:16:29 EST (Tue, 30 Nov 2010)
New Revision: 66907
URL: http://svn.boost.org/trac/boost/changeset/66907

Log:
Fixed up computation of property types; fixes #1021
Text files modified:
   trunk/boost/graph/properties.hpp | 2 +-
   trunk/boost/graph/reverse_graph.hpp | 23 +++++++++++------------
   2 files changed, 12 insertions(+), 13 deletions(-)

Modified: trunk/boost/graph/properties.hpp
==============================================================================
--- trunk/boost/graph/properties.hpp (original)
+++ trunk/boost/graph/properties.hpp 2010-11-30 13:16:29 EST (Tue, 30 Nov 2010)
@@ -266,7 +266,7 @@
   class graph_property {
   public:
     typedef typename property_value<
- typename Graph::graph_property_type, Property
+ typename boost::graph_property_type<Graph>::type, Property
>::type type;
   };
 

Modified: trunk/boost/graph/reverse_graph.hpp
==============================================================================
--- trunk/boost/graph/reverse_graph.hpp (original)
+++ trunk/boost/graph/reverse_graph.hpp 2010-11-30 13:16:29 EST (Tue, 30 Nov 2010)
@@ -79,16 +79,6 @@
 
     typedef reverse_graph_tag graph_tag;
 
- // Graph, vertex, and edge properties
- typedef typename graph_property_type<base_type>::type graph_property_type;
- typedef typename graph_bundle_type<base_type>::type graph_bundled;
-
- typedef typename vertex_property_type<base_type>::type vertex_property_type;
- typedef typename vertex_bundle_type<base_type>::type vertex_bundled;
-
- typedef typename edge_property_type<base_type>::type edge_property_type;
- typedef typename edge_bundle_type<base_type>::type edge_bundled;
-
 #ifndef BOOST_GRAPH_NO_BUNDLED_PROPERTIES
     // Bundled properties support
     template<typename Descriptor>
@@ -101,10 +91,10 @@
     operator[](Descriptor x) const
     { return m_g[x]; }
 
- graph_bundled& operator[](graph_bundle_t)
+ typename boost::graph_property_type<base_type>::type& operator[](graph_bundle_t)
     { return get_property(*this); }
 
- graph_bundled const& operator[](graph_bundle_t) const
+ typename boost::graph_property_type<base_type>::type const& operator[](graph_bundle_t) const
     { return get_property(*this); }
 #endif // BOOST_GRAPH_NO_BUNDLED_PROPERTIES
 
@@ -128,6 +118,11 @@
   typedef typename boost::edge_property_type<BidirectionalGraph>::type type;
 };
 
+template <class BidirectionalGraph, class GraphRef>
+struct graph_property_type<reverse_graph<BidirectionalGraph, GraphRef> > {
+ typedef typename boost::graph_property_type<BidirectionalGraph>::type type;
+};
+
 #ifndef BOOST_GRAPH_NO_BUNDLED_PROPERTIES
   template<typename Graph, typename GraphRef>
   struct vertex_bundle_type<reverse_graph<Graph, GraphRef> >
@@ -136,6 +131,10 @@
   template<typename Graph, typename GraphRef>
   struct edge_bundle_type<reverse_graph<Graph, GraphRef> >
     : edge_bundle_type<Graph> { };
+
+ template<typename Graph, typename GraphRef>
+ struct graph_bundle_type<reverse_graph<Graph, GraphRef> >
+ : graph_bundle_type<Graph> { };
 #endif // BOOST_GRAPH_NO_BUNDLED_PROPERTIES
 
 template <class BidirectionalGraph>


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