Boost C++ Libraries: Ticket #5650: Adding hash_value for filesystem::path https://svn.boost.org/trac10/ticket/5650 <p> Will allow to set filesystem::path to the flyweight and unordered_* by this. </p> <pre class="wiki">//in namespace boost::filesystem size_t hash_value(const path&amp; data) { return boost::hash_value(data.native()); } </pre> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/5650 Trac 1.4.3 Daniel James Tue, 28 Jun 2011 11:35:31 GMT owner, status changed https://svn.boost.org/trac10/ticket/5650#comment:1 https://svn.boost.org/trac10/ticket/5650#comment:1 <ul> <li><strong>owner</strong> changed from <span class="trac-author">Beman Dawes</span> to <span class="trac-author">Daniel James</span> </li> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">assigned</span> </li> </ul> <p> That won't work because path's operator== is not the same as the string's operator==, so paths that are equal will hash to different values. I'll write a patch when I get the chance. You also shouldn't call <code>hash_value</code> directly - if at a later date filesystem uses a custom string type, then that won't pick up its <code>hash_value</code> by ADL. </p> Ticket Beman Dawes Tue, 28 Jun 2011 13:55:30 GMT owner, status, milestone changed https://svn.boost.org/trac10/ticket/5650#comment:2 https://svn.boost.org/trac10/ticket/5650#comment:2 <ul> <li><strong>owner</strong> changed from <span class="trac-author">Daniel James</span> to <span class="trac-author">Beman Dawes</span> </li> <li><strong>status</strong> <span class="trac-field-old">assigned</span> → <span class="trac-field-new">new</span> </li> <li><strong>milestone</strong> <span class="trac-field-old">To Be Determined</span> → <span class="trac-field-new">Boost 1.48.0</span> </li> </ul> Ticket Beman Dawes Tue, 28 Jun 2011 13:57:04 GMT owner changed https://svn.boost.org/trac10/ticket/5650#comment:3 https://svn.boost.org/trac10/ticket/5650#comment:3 <ul> <li><strong>owner</strong> changed from <span class="trac-author">Beman Dawes</span> to <span class="trac-author">Daniel James</span> </li> </ul> Ticket Daniel James Sat, 02 Jul 2011 15:54:49 GMT attachment set https://svn.boost.org/trac10/ticket/5650 https://svn.boost.org/trac10/ticket/5650 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">filesystem.patch</span> </li> </ul> Ticket Daniel James Sat, 02 Jul 2011 15:55:43 GMT owner changed https://svn.boost.org/trac10/ticket/5650#comment:4 https://svn.boost.org/trac10/ticket/5650#comment:4 <ul> <li><strong>owner</strong> changed from <span class="trac-author">Daniel James</span> to <span class="trac-author">Beman Dawes</span> </li> </ul> <p> Patch attached. </p> Ticket Beman Dawes Wed, 28 Jan 2015 16:13:20 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/5650#comment:5 https://svn.boost.org/trac10/ticket/5650#comment:5 <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">fixed</span> </li> </ul> <p> The patch was applied years ago, but the ticket was not closed at that time. </p> Ticket