<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;"> const property_map<...>::const_type map; // or something similar.<br> <br> For all property maps, map = get(...) is a valid expression,<br> regardless of whether your map is a ::type or ::const_type. By<br> declaring it const, and then instantiating a template with the const<br> pmap, you're going to run into problems - probably the problem you<br> reported earlier.<br> </blockquote></div></div></blockquote><div> </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'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'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't think you should be using const property maps at all - with type or const_type. For example:<br><br>/* 1 */ property_map<...>::const_type p; // Good<br>/* 2 */ const property_map<...>::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't write:<br><br>p = q; // Assuming q is type property_map<...>::type<br> <br>It'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'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>