STL hash<> function - where is the header?

P

Pete Becker

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)
 
C

cremoni

Thanks very much for this. Very much appreciated.

I'll take a look at boost. I'm sure it has a good one.

p
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,432
Messages
2,571,680
Members
48,796
Latest member
Greg L.

Latest Threads

Top