Re: STL hash<> function - where is the header?
cremoni@gmail.com wrote:
STL has a hash function documented here: http://www.sgi.com/tech/stl/hash.html
That page document's SGI's version of the Standard Template Library.
What header do I include? I can't find it defined anywhere in the MSVC
headers.
I'm using MSVC8, BTW. Sorry if this is the wrong forum!
MSVC8 has an implementation of the C++ Standard Library. That's not the
same thing as STL. The C++ Standard Library doesn't have hashed
containers or a hash template.
TR1 (a recommendation, not a requirement) provides the hashed containers
unordered_set, unordered_multiset, unordered_map, and
unordered_multimap, as well as a hash template. The various hashed
containers are defined in <unordered_set> and <unordered_map>, and the
hash template is in <functional>. If youve got an implementation of TR1
that's where you'll find them. (For more information about TR1, see my
book, "The Standard C++ Library Extensions. Hashed containers are in
Chapter 5.)
The current draft of the next revision of the C++ standard also has
these templates, but that won't be official for a few years yet.
MS's library does have various hash_* containers, but you'll have to ask
for information about them on a Microsoft forum, or look at the
documentation on Dinkumware's web site (www.dinkumware.com).
--
-- Pete
Roundhouse Consulting, Ltd. (www.versatilecoding.com)
Author of "The Standard C++ Library Extensions: a Tutorial and
Reference." (www.petebecker.com/tr1book)