Adding hash_value for filesystem::path
Will allow to set filesystem::path to the flyweight and unordered_* by this.
//in namespace boost::filesystem
size_t hash_value(const path& data)
{
return boost::hash_value(data.native());
}
Change History
(6)
Owner: |
changed from Beman Dawes to Daniel James
|
Status: |
new → assigned
|
Milestone: |
To Be Determined → Boost 1.48.0
|
Owner: |
changed from Daniel James to Beman Dawes
|
Status: |
assigned → new
|
Owner: |
changed from Beman Dawes to Daniel James
|
Owner: |
changed from Daniel James to Beman Dawes
|
Resolution: |
→ fixed
|
Status: |
new → closed
|
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
hash_value
directly - if at a later date filesystem uses a custom string type, then that won't pick up itshash_value
by ADL.