Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C++ > STL hash<> function - where is the header?

Reply
Thread Tools

STL hash<> function - where is the header?

 
 
cremoni@gmail.com
Guest
Posts: n/a
 
      04-09-2007
STL has a hash function documented here: http://www.sgi.com/tech/stl/hash.html

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!

p

 
Reply With Quote
 
 
 
 
Pete Becker
Guest
Posts: n/a
 
      04-09-2007
http://www.velocityreviews.com/forums/(E-Mail Removed) 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)
 
Reply With Quote
 
 
 
 
cremoni@gmail.com
Guest
Posts: n/a
 
      04-09-2007
Thanks very much for this. Very much appreciated.

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

p

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Segmentation Fault on stl::resize / stl::clear Steve C++ 2 11-06-2007 06:53 AM
stl questions: how can I compare 2 stl list? silverburgh.meryl@gmail.com C++ 5 04-16-2006 09:57 PM
a stl map which use stl pair as the key Allerdyce.John@gmail.com C++ 2 02-22-2006 07:25 AM
Copy elements from one STL container to another STL container Marko.Cain.23@gmail.com C++ 4 02-16-2006 05:03 PM
To STL or not to STL Allan Bruce C++ 41 10-17-2003 08:21 PM



Advertisments