-2

Like the title says, unordered_map isn't compiling for me. I get an error saying "error: namespace "std" has no member "unordered_map""

I'm compiling with this command icc test.cpp -std=c++0x

This is the program I'm trying to compile:

#include <stdio.h>
#include <string>

int main()
{
  std::unordered_map<string, int> map;
}

1 Answers1

1
#include <unordered_map>

See: http://en.cppreference.com/w/cpp/container/unordered_map

Defined in header <unordered_map>

Mark Garcia
  • 17,424
  • 4
  • 58
  • 94
  • Thanks so much. Why does it need to be included in the header if it's in the std namespace? – user2142343 Aug 06 '13 at 05:00
  • @user2142343 Because it is how the standard library is designed. It needs you to include the necessary header for a particular component in order to use it. – Mark Garcia Aug 06 '13 at 05:09