[Boost-bugs] [Boost C++ Libraries] #4188: get() cannot take a const argument for the graph

Subject: [Boost-bugs] [Boost C++ Libraries] #4188: get() cannot take a const argument for the graph
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2010-05-04 18:41:45


#4188: get() cannot take a const argument for the graph
------------------------------------------------------+---------------------
 Reporter: Trevor Harmon <Trevor.W.Harmon@…> | Owner: asutton
     Type: Bugs | Status: new
Milestone: Boost 1.43.0 | Component: graph
  Version: Boost 1.42.0 | Severity: Problem
 Keywords: |
------------------------------------------------------+---------------------
 Passing a graph variable declared as const should be allowed when calling
 the get() function. However, this causes a compiler error.

 To reproduce:

 Look at line 54 of the canonical_ordering example:

 graph g(6);
 ...
 property_map<graph, edge_index_t>::type e_index = get(edge_index, g);

 Change the graph parameter to a const:

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

 This gives a compiler error with Boost 1.42.0, g++ 4.0.1, Mac OS X:

 conversion from
 â€˜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>’ to non-scalar type
 â€˜boost::adj_list_edge_property_map<boost::undirected_tag, int, int&,
 size_t, boost::property<boost::edge_index_t, int, boost::no_property>,
 boost::edge_index_t>’ requested

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/4188>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:03 UTC