Boost logo

Boost Users :

Subject: Re: [Boost-users] Boost Graph: why can't get() take a const argument?
From: Trevor Harmon (Trevor.W.Harmon_at_[hidden])
Date: 2010-05-07 20:32:41


On May 5, 2010, at 11:52 AM, Jeremiah Willcock wrote:

> Is using property_map<graph>::const_type not acceptable? That does
> work
> right now.

I can't seem to get const_type to work. If I understand its usage
correctly, I can pass a const graph to get() like this (from
canonical_ordering.cpp):

   const graph g2 = g;
   property_map<graph, edge_index_t>::const_type e_index =
get(edge_index, g2);

But that just gives me a different kind of compiler error:

/Users/twharmon/Development/boost_1_42_0/boost/property_map/
property_map.hpp: In function ‘void boost::put(const
boost::put_get_helper<Reference, PropertyMap>&, K, const V&) [with
PropertyMap = boost::adj_list_edge_property_map<boost::undirected_tag,
int, const int&, size_t, const boost::property<boost::edge_index_t,
int, boost::no_property>, boost::edge_index_t>, Reference = const
int&, K = boost::detail::edge_desc_impl<boost::undirected_tag,
size_t>, V = size_t]’:
canonical_ordering.cpp:60: instantiated from here
/Users/twharmon/Development/boost_1_42_0/boost/property_map/
property_map.hpp:325: error: assignment of read-only location

Am I using const_type incorrectly? Thanks,

Trevor


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net