Boost logo

Boost Users :

Subject: Re: [Boost-users] C++11, boost::filesystem::path, no std::hash specialization
From: Nathan Crookston (nathan.crookston_at_[hidden])
Date: 2012-12-02 17:46:36


Hi Benjamin,

On Sun, Dec 2, 2012 at 1:57 PM, Benjamin Kircher <benjamin.kircher_at_[hidden]
> wrote:

> I cannot use boost::filesystem::path with an e.g. unordered_set because
> std::hash seems not to be specialized for this type. Is this intended?
> Should I file a bug? Or am I completely misguided?
>

I can't comment on whether filesystem::path should be extended to work with
boost hash, but I wanted to point out that you could supply your own
hashing object (not boost hash, but using hash_combine) without needing to
do anything in the boost namespace. That would work now and in the
possible future where filesystem::path supports boost::hash.

See <
http://www.boost.org/doc/libs/1_52_0/doc/html/unordered/hash_equality.html>.
 The patch Daniel James attached to the ticket you referenced is probably a
good starting point for implementing something like that.

HTH,
Nate



Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net