From 21b44fcbc37a367dbc31b2f0b90bbc7526342fb1 Mon Sep 17 00:00:00 2001 From: Matthew Barr Date: Thu, 20 Oct 2016 09:49:10 +1100 Subject: [PATCH] Add the missing degree() in Boost 1.62 This is a workaround that fixes issue #39 --- include/boost-patched/graph/reverse_graph.hpp | 27 +++++++++++++++++++ src/nfagraph/ng_dominators.cpp | 4 +-- 2 files changed, 29 insertions(+), 2 deletions(-) create mode 100644 include/boost-patched/graph/reverse_graph.hpp diff --git a/include/boost-patched/graph/reverse_graph.hpp b/include/boost-patched/graph/reverse_graph.hpp new file mode 100644 index 00000000..07a11f9b --- /dev/null +++ b/include/boost-patched/graph/reverse_graph.hpp @@ -0,0 +1,27 @@ +#ifndef REVERSE_GRAPH_PATCHED_H_ +#define REVERSE_GRAPH_PATCHED_H_ + +#include + +#include + +#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 +inline typename graph_traits::degree_size_type +degree(const typename graph_traits::vertex_descriptor u, + const reverse_graph& g) +{ + return degree(u, g.m_g); +} + +} // namespace boost + +#endif // Boost 1.62.0 + +#endif diff --git a/src/nfagraph/ng_dominators.cpp b/src/nfagraph/ng_dominators.cpp index f2980e17..05650aaf 100644 --- a/src/nfagraph/ng_dominators.cpp +++ b/src/nfagraph/ng_dominators.cpp @@ -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 // locally patched version -#include +#include using namespace std; using boost::make_assoc_property_map;