I’m using Visual Studio 2008. This is my code:
#include "stdafx.h"
#include <conio.h>
#include <hash_map>
#include <iostream>
using namespace std;
hash_map <int, int> hm;
int main()
{
return 0;
}
And here’s my error:
error C2143: syntax error : missing ';' before '<'
error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
In the MSVC compiler, extensions to the standard library are placed in the
stdextnamespace:Disclaimer: I don’t own VS2008 but this should work. 🙂
Note, though, that you should update to the latest compiler if possible and use the new standard unordered containers instead:
std::unordered_mapandstd::unordered_set.