[v3] Add hash<shared_ptr> and hash<unique_ptr>

Paolo Carlini paolo.carlini@oracle.com
Fri Jun 11 16:00:00 GMT 2010


Hi all, hi Jon,

I'm about to commit this patch adding two missing std::hash
specializations...

Jon, skimming through unique_ptr.h I don't really understand why we are
using std::tuple instead of the *much* simpler std::pair. Can you? I
think that otherwise we should consider changing that, even if that
means breaking the "ABI" for people already experimenting with the C++0x
unique_ptr, because in the future it will be more and more difficult...
If we can avoid using tuple in unique_ptr, I think <memory> can be made
*much* smaller (it used to be very small), because I'm pretty sure we
don't need the entire <functional>, only some bits, like
functional_hash, and very little else.

Tested x86_64-linux.

Paolo.

/////////////////////
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: CL_su_hash
URL: <http://gcc.gnu.org/pipermail/libstdc++/attachments/20100611/e5a7676d/attachment.ksh>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: patch_su_hash
URL: <http://gcc.gnu.org/pipermail/libstdc++/attachments/20100611/e5a7676d/attachment-0001.ksh>


More information about the Libstdc++ mailing list