Ticket #6391: reverse_graph_desc.patch
File reverse_graph_desc.patch, 1.7 KB (added by , 11 years ago) |
---|
-
.hpp
old new struct reverse_graph_tag { }; 25 25 namespace detail { 26 26 27 27 template <typename EdgeDesc> 28 class reverse_graph_edge_descriptor { 29 public: 30 EdgeDesc underlying_desc; 31 28 class reverse_graph_edge_descriptor: public EdgeDesc { 32 29 public: 30 typedef EdgeDesc base_t; 33 31 explicit reverse_graph_edge_descriptor(const EdgeDesc& underlying_desc = EdgeDesc()) 34 : underlying_desc(underlying_desc) {} 35 36 friend bool operator==(const reverse_graph_edge_descriptor& a, const reverse_graph_edge_descriptor& b) { 37 return a.underlying_desc == b.underlying_desc; 38 } 39 friend bool operator!=(const reverse_graph_edge_descriptor& a, const reverse_graph_edge_descriptor& b) { 40 return a.underlying_desc != b.underlying_desc; 41 } 32 : base_t(underlying_desc) {} 42 33 }; 43 34 44 35 template <typename EdgeDesc> … … template <class Edge, class Bidirectiona 280 271 inline typename graph_traits<BidirectionalGraph>::vertex_descriptor 281 272 source(const detail::reverse_graph_edge_descriptor<Edge>& e, const reverse_graph<BidirectionalGraph,GRef>& g) 282 273 { 283 return target( e.underlying_desc, g.m_g);274 return target(Edge(e), g.m_g); 284 275 } 285 276 286 277 template <class Edge, class BidirectionalGraph, class GRef> 287 278 inline typename graph_traits<BidirectionalGraph>::vertex_descriptor 288 279 target(const detail::reverse_graph_edge_descriptor<Edge>& e, const reverse_graph<BidirectionalGraph,GRef>& g) 289 280 { 290 return source( e.underlying_desc, g.m_g);281 return source(Edge(e), g.m_g); 291 282 } 292 283 293 284