STL hash<> function - where is the header?

Discussion in 'C++' started by cremoni@gmail.com, Apr 9, 2007.

  1. Guest

    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
     
    , Apr 9, 2007
    #1
    1. Advertising

  2. Pete Becker Guest

    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)
     
    Pete Becker, Apr 9, 2007
    #2
    1. Advertising

  3. Guest

    Thanks very much for this. Very much appreciated.

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

    p
     
    , Apr 9, 2007
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Allan Bruce

    To STL or not to STL

    Allan Bruce, Oct 16, 2003, in forum: C++
    Replies:
    41
    Views:
    1,128
    Christopher Benson-Manica
    Oct 17, 2003
  2. Replies:
    4
    Views:
    832
    Daniel T.
    Feb 16, 2006
  3. mlt
    Replies:
    2
    Views:
    916
    Jean-Marc Bourguet
    Jan 31, 2009
  4. rp
    Replies:
    1
    Views:
    595
    red floyd
    Nov 10, 2011
  5. Srijayanth Sridhar
    Replies:
    19
    Views:
    676
    David A. Black
    Jul 2, 2008
Loading...

Share This Page