Blob Blame History Raw
diff --git a/libs/database/imagehistory/imagehistorygraph_boost.h b/libs/database/imagehistory/imagehistorygraph_boost.h
index 6ffccce..52162e9 100644
--- a/libs/database/imagehistory/imagehistorygraph_boost.h
+++ b/libs/database/imagehistory/imagehistorygraph_boost.h
@@ -34,6 +34,7 @@
 
 #include <utility>
 #include <algorithm>
+#include <boost/version.hpp>
 #include <boost/graph/transitive_closure.hpp>
 #include <boost/graph/adjacency_list.hpp>
 #include <boost/graph/topological_sort.hpp>
@@ -188,6 +189,9 @@ public:
 
         Edge() : null(true) {}
         Edge(const edge_t& e) : e(e), null(false) {}
+#if BOOST_VERSION >= 104700
+        Edge(const boost::detail::reverse_graph_edge_descriptor<edge_t>& e) : e(e.underlying_desc), null(false) {}
+#endif
 
         Edge& operator=(const edge_t& other)
         {
@@ -1049,6 +1053,15 @@ protected:
         return toList<Edge, range_t>(range);
     }
 
+    template <class GraphType>
+    class edge_desc_maker {
+        public:
+        template <typename range_t> static QList<typename boost::graph_traits<GraphType>::edge_descriptor> toEdgeDescList(const range_t& range)
+        {
+            return toList<typename boost::graph_traits<GraphType>::edge_descriptor, range_t>(range);
+        }
+    };
+
     template <typename range_t>
     static bool isEmptyRange(const range_t& range)
     {
@@ -1198,7 +1211,7 @@ protected:
             {
                 boost::dag_shortest_paths(graph, v,
                                           // we provide a constant weight of 1
-                                          weight_map(boost::ref_property_map<edge_t,int>(weight)).
+                                          weight_map(boost::ref_property_map<typename boost::graph_traits<GraphType>::edge_descriptor,int>(weight)).
                                           // Store distance and predecessors in QMaps, wrapped to serve as property maps
                                           distance_map(VertexIntMapAdaptor(distances)).
                                           predecessor_map(VertexVertexMapAdaptor(predecessors))
@@ -1218,7 +1231,7 @@ protected:
             {
                 boost::dag_shortest_paths(graph, v,
                                           // we provide a constant weight of 1
-                                          weight_map(boost::ref_property_map<edge_t,int>(weight)).
+                                          weight_map(boost::ref_property_map<typename boost::graph_traits<GraphType>::edge_descriptor,int>(weight)).
                                           // Invert the default compare method: With greater, we get the longest path
                                           distance_compare(std::greater<int>()).
                                           // will be returned if a node is unreachable
@@ -1389,9 +1402,10 @@ protected:
                 : g(g), vertexLessThan(vertexLessThan) {}
             const GraphType& g;
             VertexLessThan vertexLessThan;
-            bool operator()(const Edge& a, const Edge& b)
+            bool operator()(const typename boost::graph_traits<GraphType>::edge_descriptor& a,
+                            const typename boost::graph_traits<GraphType>::edge_descriptor& b)
             {
-                return vertexLessThan(boost::target(a.toEdge(), g), boost::target(b.toEdge(), g));
+                return vertexLessThan(boost::target(a, g), boost::target(b, g));
             }
         };
 
@@ -1402,20 +1416,21 @@ protected:
         {
             typedef std::pair<Vertex, QList<Edge> > VertexInfo;
 
-            QList<Edge>             outEdges;
+            QList<typename boost::graph_traits<IncidenceGraph>::edge_descriptor> outEdges;
             std::vector<VertexInfo> stack;
 
             boost::put(color, u, boost::gray_color);
             vis.discover_vertex(u, g);
 
-            outEdges = toEdgeList(boost::out_edges(u, g));
+            outEdges = edge_desc_maker<IncidenceGraph>::toEdgeDescList(boost::out_edges(u, g));
             // Sort edges. The lessThan we have takes vertices, so we use a lessThan which
             // maps the given edges to their targets, and calls our vertex lessThan.
             qSort(outEdges.begin(), outEdges.end(), lessThanMapEdgeToTarget<IncidenceGraph, LessThan>(g, lessThan));
 
-            foreach(const Edge& e, outEdges)
+            foreach(const typename boost::graph_traits<IncidenceGraph>::edge_descriptor& ed, outEdges)
             {
-                Vertex v = boost::target(e.toEdge(), g);
+                Edge e = ed;
+                Vertex v = boost::target(ed, g);
                 vis.examine_edge(e, g);
                 boost::default_color_type v_color = boost::get(color, v);
                 if (v_color == boost::white_color)