STL for hash tables

Jun 15, 2009 at 1:56pm
Is there an STL implementation available for hash tables? If so, what is the name of the library?

Thanks.
Jun 15, 2009 at 2:37pm
Jun 15, 2009 at 5:06pm
He asked for a hash table. Try TR1's unordered_map.
Jun 15, 2009 at 6:38pm
@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?
Jun 15, 2009 at 7:38pm
This works in MSVC++:

1
2
3
4
5
6
#include <unordered_map>

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

Jun 15, 2009 at 8:50pm
That is an extension which should be available with C++0x but is not part of the current standard
Jun 15, 2009 at 10:21pm
It's available now in tr1.
Jun 16, 2009 at 1:10pm
I have MS Studio 6.0 and it doesn't compile. I wonder what version do you run?
Jun 16, 2009 at 1:18pm
closed account (z05DSL3A)
2008 with the feature pack installed would be my guess. (I think it is also in SP1)
Last edited on Jun 16, 2009 at 1:23pm
Jun 16, 2009 at 1:20pm
VC++ 6 may not even compile ISO C++, The current version should be 9
Jun 16, 2009 at 2:51pm
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 Jun 16, 2009 at 2:52pm
Jun 16, 2009 at 3:02pm
Have you created a new (empty) project?
Jun 16, 2009 at 3:49pm
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?
Jun 16, 2009 at 3:52pm
The project you start with should be Empty Project
Jun 16, 2009 at 3:54pm
Thanks to all, its working now.
Last edited on Jun 16, 2009 at 3:55pm
Jun 16, 2009 at 3:57pm
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 Jun 16, 2009 at 3:59pm
Topic archived. No new replies allowed.