If I want to use the hash function object provided in STL, which header file I should include on Linux? e.g. hash Hf;
+1
A:
#include <hash_map>
on some Linux distros it's available here:
#include <ext/hash_map>
More info here. The hash_map is currently not part of the official STL but it's in TR1 as <unordered_map>
.
Andreas Brinck
2009-12-02 17:58:27
I know it's an extension but most C++ compilers support it.
Andreas Brinck
2009-12-02 18:02:54
or <tr1/hash_map>
Samuel_xL
2009-12-02 18:04:49
A:
Is this what you are looking for:
Definition Defined in the headers hash_map and hash_set, and in the backward-compatibility headers hash_map.h and hash_set.h. This class is an SGI extension; it is not part of the C++ standard.
Priyank Bolia
2009-12-02 18:00:14
A:
And if you like reading standards proposals, here's a copy of Matt Austern's, A Proposal to Add Hash Tables to the Standard Library.
Don Wakefield
2009-12-02 18:09:42