<div class="gmail_quote"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div><div class="Wj3C7c"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
&nbsp;&nbsp; const property_map&lt;...&gt;::const_type map; // or something similar.<br>
<br>
 &nbsp; &nbsp;For all property maps, map = get(...) is a valid expression,<br>
 &nbsp; &nbsp;regardless of whether your map is a ::type or ::const_type. By<br>
 &nbsp; &nbsp;declaring it const, and then instantiating a template with the const<br>
 &nbsp; &nbsp;pmap, you&#39;re going to run into problems - probably the problem you<br>
 &nbsp; &nbsp;reported earlier.<br>
</blockquote></div></div></blockquote><div>&nbsp;</div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div><div class="Wj3C7c"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br></blockquote></div></div>
Okay, so if I understand correctly I shouldn&#39;t use const prop maps with const_type at all?<br>
<br>
It seems to me like a line such as the above should still theoretically compile. At least from the perspective of a concept check for Readability; this is by definition what const is meant to restrict objects to so in theory in should be allowable no? If I&#39;m right it would be a compilation error caused by the underlying implementation. Either that or a debatable foible that should be documented? *shrug*.</blockquote>
<div><br>I don&#39;t think you should be using const property maps at all - with type or const_type. For example:<br><br>/* 1 */ property_map&lt;...&gt;::const_type p;&nbsp; // Good<br>/* 2 */ const property_map&lt;...&gt;::const_type p; // Bad<br>
<br>The const_type in 1 forces the p to operate on its underlying reference in a const way. Returing const references, no put() operation, etc. The leading const in 2 means that you can&#39;t write:<br><br>p = q; // Assuming q is type property_map&lt;...&gt;::type<br>
<br>It&#39;s a compiler error since p is not modifiable.<br><br>If you look at the concept definition in boost/property_map.hpp for ReadablePropertyMapConcept, you&#39;ll find, in the constraints() member, this line:<br><br>
val = get(pmap, k)<br><br>So apparently, the concept definition actually requires that property maps are never const - which is admittedly a little weird.<br><br></div></div>Andrew Sutton<br><a href="mailto:andrew.n.sutton@gmail.com">andrew.n.sutton@gmail.com</a><br>