|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r83191 - trunk/boost/graph
From: jewillco_at_[hidden]
Date: 2013-02-27 17:04:19
Author: jewillco
Date: 2013-02-27 17:04:17 EST (Wed, 27 Feb 2013)
New Revision: 83191
URL: http://svn.boost.org/trac/boost/changeset/83191
Log:
Fixed handling of const graphs and property maps; fixes #8192
Text files modified:
trunk/boost/graph/reverse_graph.hpp | 9 ++++++++-
1 files changed, 8 insertions(+), 1 deletions(-)
Modified: trunk/boost/graph/reverse_graph.hpp
==============================================================================
--- trunk/boost/graph/reverse_graph.hpp (original)
+++ trunk/boost/graph/reverse_graph.hpp 2013-02-27 17:04:17 EST (Wed, 27 Feb 2013)
@@ -109,6 +109,8 @@
// Constructor
reverse_graph(GraphRef g) : m_g(g) {}
+ // Conversion from reverse_graph on non-const reference to one on const reference
+ reverse_graph(const reverse_graph<BidirectionalGraph, BidirectionalGraph&>& o): m_g(o.m_g) {}
// Graph requirements
typedef typename Traits::vertex_descriptor vertex_descriptor;
@@ -364,7 +366,12 @@
template <class BidirGraph, class GRef, class Property>
struct property_map<reverse_graph<BidirGraph, GRef>, Property> {
typedef boost::is_same<typename detail::property_kind_from_graph<BidirGraph, Property>::type, edge_property_tag> is_edge_prop;
- typedef typename property_map<BidirGraph, Property>::type orig_type;
+ typedef boost::is_const<typename boost::remove_reference<GRef>::type> is_ref_const;
+ typedef typename boost::mpl::if_<
+ is_ref_const,
+ typename property_map<BidirGraph, Property>::const_type,
+ typename property_map<BidirGraph, Property>::type>::type
+ orig_type;
typedef typename property_map<BidirGraph, Property>::const_type orig_const_type;
typedef typename boost::mpl::if_<is_edge_prop, detail::reverse_graph_edge_property_map<orig_type>, orig_type>::type type;
typedef typename boost::mpl::if_<is_edge_prop, detail::reverse_graph_edge_property_map<orig_const_type>, orig_const_type>::type const_type;
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