Boost C++ Libraries: Ticket #914: problem with lvalue property maps https://svn.boost.org/trac10/ticket/914 <pre class="wiki">[Boost 1.21.1 with egcs 2.95.2] The code at the end of this report gives me the compiler error /usr/local/include/boost/graph/detail/adjacency_list.hpp: In method `double &amp; boost::vec_adj_list_vertex_property_map&lt;boost::adjacency_list&lt;boost::vecS,boost::vecS,boost::bidirectionalS,boost::property&lt;vertex_info_t,double,boost::no_property&gt;,boost::no_property,boost::no_property&gt;,const boost::adjacency_list&lt;boost::vecS,boost::vecS,boost::bidirectionalS,boost::property&lt;vertex_info_t,double,boost::no_property&gt;,boost::no_property,boost::no_property&gt; &amp;,boost::property&lt;vertex_info_t,double,boost::no_property&gt;,vertex_info_t&gt;::operator [](unsigned int)': foo.cc:19: instantiated from here /usr/local/include/boost/graph/detail/adjacency_list.hpp:2084: conversion from `const double' to `double &amp;' discards qualifiers Apparently operator[] leaves out the const in its return type for the const_type version of a property map. ------------- code begins -------------- #include &lt;boost/graph/properties.hpp&gt; #include &lt;boost/graph/adjacency_list.hpp&gt; using namespace boost; struct vertex_info_t { }; namespace boost { BOOST_INSTALL_PROPERTY(vertex, info); }; typedef property&lt;vertex_info_t, double&gt; vertex_properties; typedef adjacency_list&lt;vecS, vecS, bidirectionalS, vertex_properties&gt; graph_t; double const &amp; foo(graph_t const &amp; x) { property_map&lt;graph_t, vertex_info_t&gt;::const_type pmap = get(vertex_info_t(), x); return pmap[vertex(0, x)]; } </pre> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/914 Trac 1.4.3 jsiek Thu, 05 Apr 2001 17:28:29 GMT status changed https://svn.boost.org/trac10/ticket/914#comment:1 https://svn.boost.org/trac10/ticket/914#comment:1 <ul> <li><strong>status</strong> <span class="trac-field-old">assigned</span> → <span class="trac-field-new">closed</span> </li> </ul> <pre class="wiki">Logged In: YES user_id=32836 Yes, this is a bug. I've fixed it and checked the changes into CVS. Also added the above file into the test suite. </pre> Ticket