Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r57910 - trunk/boost/graph
From: jewillco_at_[hidden]
Date: 2009-11-24 16:35:31


Author: jewillco
Date: 2009-11-24 16:35:30 EST (Tue, 24 Nov 2009)
New Revision: 57910
URL: http://svn.boost.org/trac/boost/changeset/57910

Log:
Fixed graph property constness issues
Text files modified:
   trunk/boost/graph/reverse_graph.hpp | 7 ++++++-
   1 files changed, 6 insertions(+), 1 deletions(-)

Modified: trunk/boost/graph/reverse_graph.hpp
==============================================================================
--- trunk/boost/graph/reverse_graph.hpp (original)
+++ trunk/boost/graph/reverse_graph.hpp 2009-11-24 16:35:30 EST (Tue, 24 Nov 2009)
@@ -9,6 +9,8 @@
 #include <boost/graph/adjacency_iterator.hpp>
 #include <boost/graph/properties.hpp>
 #include <boost/tuple/tuple.hpp>
+#include <boost/type_traits.hpp>
+#include <boost/mpl/if.hpp>
 
 #if BOOST_WORKAROUND(BOOST_MSVC, < 1300)
 // Stay out of the way of the concept checking class
@@ -324,7 +326,10 @@
 
 template<typename BidirectionalGraph, typename GRef, typename Tag>
 inline
-typename graph_property<BidirectionalGraph, Tag>::type
+typename boost::mpl::if_<
+ boost::is_const<typename boost::remove_reference<GRef>::type>,
+ const typename graph_property<BidirectionalGraph, Tag>::type&,
+ typename graph_property<BidirectionalGraph, Tag>::type& >::type
 get_property(const reverse_graph<BidirectionalGraph,GRef>& g, Tag tag)
 {
   return get_property(g.m_g, tag);


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