Boost C++ Libraries: Ticket #6543: identity_property_map is not overloaded for any key type https://svn.boost.org/trac10/ticket/6543 <p> The following assertion fails, because a is first cast to size_t and then to double. Leaving us with a = 0.5 and b = 0.0 </p> <blockquote> <p> boost::identity_property_map identity; double a = 0.5; double b = get(identity, a); assert(a==b); </p> </blockquote> <p> I am submitting a patch that introduces (reinstates?) the overloads that are promised in the documentation. </p> <p> The patch contains an additional property map: identity_ref_property_map, which is a identity_property_map that returns a reference to the key, instead of a copy of the key. </p> <p> Including that struct is up to your discretion, it is not really part of the patch. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/6543 Trac 1.4.3 Alex Hagen-Zanker <ahh34@…> Fri, 10 Feb 2012 14:32:36 GMT attachment set https://svn.boost.org/trac10/ticket/6543 https://svn.boost.org/trac10/ticket/6543 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">property_map_hpp.patch</span> </li> </ul> <p> patch to property_map.hpp </p> Ticket Jeremiah Willcock Fri, 10 Feb 2012 18:11:30 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/6543#comment:1 https://svn.boost.org/trac10/ticket/6543#comment:1 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">wontfix</span> </li> </ul> <p> There is a <code>typed_identity_property_map</code> that does what you want; <code>identity_property_map</code> is deprecated for exactly the reasons that you mention. </p> Ticket Alex Hagen-Zanker Fri, 10 Feb 2012 21:23:14 GMT <link>https://svn.boost.org/trac10/ticket/6543#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/6543#comment:2</guid> <description> <p> Ok, if identity_property_map is deprecated, than the code can remain as it is. It does mean that the documentation is outdated. When I have a chance I will see if I can correct the page on identity_property_map </p> </description> <category>Ticket</category> </item> </channel> </rss>