STL for hash tables

Is there an STL implementation available for hash tables? If so, what is the name of the library?

Thanks.
He asked for a hash table. Try TR1's unordered_map.
@Bazzy: I have used maps before, I wanted to know about the hash tables.

@Hammurabi: I tried unordered maps before, and it gives error:
1
2
fatal error C1083: Cannot open include file: 'tr1/unordered_map': No such file or directory
Error executing cl.exe.


Can you suggest where can I install it from? and Where to install?
This works in MSVC++:

1
2
3
4
5
6
#include <unordered_map>

int main()
{
    std::tr1::unordered_map<int, int> m;
}

That is an extension which should be available with C++0x but is not part of the current standard
It's available now in tr1.
I have MS Studio 6.0 and it doesn't compile. I wonder what version do you run?
closed account (z05DSL3A)
2008 with the feature pack installed would be my guess. (I think it is also in SP1)
Last edited on
VC++ 6 may not even compile ISO C++, The current version should be 9
I downloaded MS Visual Studio Express Edition 2008 (which is 9.0) and wrote a sample program. The "Build" button is disabled though. Tried to search on the web, with no avail.

Anybody experienced this before? How do I activate it?
Last edited on
Have you created a new (empty) project?
The Build button is active after creating new project (Win32 Console app). However, now when I create new project, there are 2 new files (1 src and 1 header) added to the project by default: stdafx.h and stdafx.cpp. And the project doesn't seem to compile without them. How do I get rid of them?
The project you start with should be Empty Project
Thanks to all, its working now.
Last edited on
closed account (z05DSL3A)
Right click on the project in solution explorer. Select properties. Navigate to Configuration Properties->C/C++->Pre-compiled Headers(in the left hand pane, in the right hand pane change Create/Use Precompiled Headers to Not Using Precompiled Headers. Click OK.

Edit:
oh well, create new Empty Project is quicker than editing the properties. :0)

Last edited on
Topic archived. No new replies allowed.