]> git.ipfire.org Git - thirdparty/vectorscan.git/commitdiff
Add the missing degree() in Boost 1.62
authorMatthew Barr <matthew.barr@intel.com>
Wed, 19 Oct 2016 22:49:10 +0000 (09:49 +1100)
committerMatthew Barr <matthew.barr@intel.com>
Mon, 14 Nov 2016 22:52:37 +0000 (09:52 +1100)
This is a workaround that fixes issue #39

include/boost-patched/graph/reverse_graph.hpp [new file with mode: 0644]
src/nfagraph/ng_dominators.cpp

diff --git a/include/boost-patched/graph/reverse_graph.hpp b/include/boost-patched/graph/reverse_graph.hpp
new file mode 100644 (file)
index 0000000..07a11f9
--- /dev/null
@@ -0,0 +1,27 @@
+#ifndef REVERSE_GRAPH_PATCHED_H_
+#define REVERSE_GRAPH_PATCHED_H_
+
+#include <boost/version.hpp>
+
+#include <boost/graph/reverse_graph.hpp>
+
+#if (BOOST_VERSION == 106200)
+
+// Boost 1.62.0 does not implement degree() in reverse_graph which is required
+// by BidirectionalGraph, so add it.
+
+namespace boost {
+
+template <class BidirectionalGraph, class GRef>
+inline typename graph_traits<BidirectionalGraph>::degree_size_type
+degree(const typename graph_traits<BidirectionalGraph>::vertex_descriptor u,
+       const reverse_graph<BidirectionalGraph,GRef>& g)
+{
+    return degree(u, g.m_g);
+}
+
+} // namespace boost
+
+#endif // Boost 1.62.0
+
+#endif
index f2980e171926cb5ca38e6ab49b2cc207386950b1..05650aaf3b632c7cc4b6f200fddad51995f5ddca 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, Intel Corporation
+ * Copyright (c) 2015-16, Intel Corporation
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are met:
@@ -39,7 +39,7 @@
 #include "util/ue2_containers.h"
 
 #include <boost-patched/graph/dominator_tree.hpp> // locally patched version
-#include <boost/graph/reverse_graph.hpp>
+#include <boost-patched/graph/reverse_graph.hpp>
 
 using namespace std;
 using boost::make_assoc_property_map;