title: Unordered_map<string, int> works but Unordered_map<string, string> does not
body: <p>I don't understand why the second block of code in this short example does not compile correctly. It is my understanding that the second parameter in the &lt;> represents the value, which doesn't need to be unique. Why is the second block of code throwing a compiler error, and what do I need to do to remedy it? </p>
  
  <pre><code>// Unordered Map example .cpp
  
  #include &lt;stdio.h&gt;
  #include &lt;string&gt;
  #include &lt;cstring&gt;
  #include &lt;unordered_map&gt;
  
  using namespace std;
  
  int main(void) {
  
      // This works as expected
      unordered_map&lt;std::string, int&gt; m;
      m["foo"] = 42;
      printf("%i\n", m["foo"]);
  
      // This this doesn't compile
      unordered_map&lt;std::string, std::string&gt; m1;
      m1["foo"] = "42";
      printf("%s\n", m1["foo"]);
  
      return 0;
  }
  </code></pre>
  
  <p>I am compiling this code on CentOS 5.8 using</p>
  
  <pre><code>g++44 -c -Wall -std=c++0x -g map_example.cpp
  </code></pre>
  
  <p>and these are the errors I am getting</p>
  
  <pre><code>map_example.cpp: In function ‘int main()’:
  map_example.cpp:20: warning: cannot pass objects of non-POD type ‘struct std::basic_string&lt;char, std::char_traits&lt;char&gt;, std::allocator&lt;char&gt; &gt;’ through ‘...’; call will abort at runtime
  map_example.cpp:20: warning: format ‘%s’ expects type ‘char*’, but argument 2 has type ‘int’
  </code></pre>
  
  <p>If I am having trouble with a basic c++ class such a std:string what do I need to do to have a custom class as a value, where can I find a fully implemented minimal example?</p>