Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r77609 - trunk/boost/graph
From: jewillco_at_[hidden]
Date: 2012-03-28 16:20:46


Author: jewillco
Date: 2012-03-28 16:20:45 EDT (Wed, 28 Mar 2012)
New Revision: 77609
URL: http://svn.boost.org/trac/boost/changeset/77609

Log:
Fixed categories of property maps for subgraph based on constness of graph; fixes #6739
Text files modified:
   trunk/boost/graph/subgraph.hpp | 14 +++++++++++---
   1 files changed, 11 insertions(+), 3 deletions(-)

Modified: trunk/boost/graph/subgraph.hpp
==============================================================================
--- trunk/boost/graph/subgraph.hpp (original)
+++ trunk/boost/graph/subgraph.hpp 2012-03-28 16:20:45 EDT (Wed, 28 Mar 2012)
@@ -24,7 +24,9 @@
 
 #include <boost/static_assert.hpp>
 #include <boost/assert.hpp>
-#include <boost/type_traits/is_same.hpp>
+#include <boost/type_traits.hpp>
+#include <boost/mpl/if.hpp>
+#include <boost/mpl/or.hpp>
 
 namespace boost {
 
@@ -777,7 +779,10 @@
 {
     typedef property_traits<PropertyMap> Traits;
 public:
- typedef typename Traits::category category;
+ typedef typename mpl::if_<is_const<typename remove_pointer<GraphPtr>::type>,
+ readable_property_map_tag,
+ typename Traits::category>::type
+ category;
     typedef typename Traits::value_type value_type;
     typedef typename Traits::key_type key_type;
     typedef typename Traits::reference reference;
@@ -813,7 +818,10 @@
 {
     typedef property_traits<PropertyMap> Traits;
 public:
- typedef typename Traits::category category;
+ typedef typename mpl::if_<is_const<typename remove_pointer<GraphPtr>::type>,
+ readable_property_map_tag,
+ typename Traits::category>::type
+ category;
     typedef typename Traits::value_type value_type;
     typedef typename Traits::key_type key_type;
     typedef typename Traits::reference reference;


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