title: std::unordered_map insertion error
body: <p>I have the following unordered_map, that maps a pointer to an object of type Item with a key of type int.</p>
  
  <pre><code>typedef std::unordered_map&lt;int, Item*&gt; ItemList;
  ItemList Items;
  </code></pre>
  
  <p>However, in my addItem method, I receive a strange error at compilation.</p>
  
  <pre><code>void ItemManager::addItem(Item *it)  {
      int i = it-&gt;getItemID();
      Items.insert(ItemList::value_type(i, *it));
  }
  </code></pre>
  
  <p>Yields:</p>
  
  <pre><code>item_manager.cc: In member function ‘void ItemManager::addItem(Item*)’:
  item_manager.cc:31:51: error: no matching function for call to ‘std::pair&lt;const int, Item*&gt;::pair(int&amp;, Item&amp;)’
  item_manager.cc:31:51: note: candidates are:
  /usr/include/c++/4.6/bits/stl_pair.h:140:2: note: template&lt;class ... _Args1, class ... _Args2&gt; std::pair::pair(std::piecewise_construct_t, std::tuple&lt;_Args1 ...&gt;, std::tuple&lt;_Args2 ...&gt;)
  /usr/include/c++/4.6/bits/stl_pair.h:135:2: note: template&lt;class _U1, class _U2&gt; std::pair::pair(std::pair&lt;_U1, _U2&gt;&amp;&amp;)
  /usr/include/c++/4.6/bits/stl_pair.h:131:2: note: template&lt;class _U1, class _U2, class&gt; std::pair::pair(_U1&amp;&amp;, _U2&amp;&amp;)
  /usr/include/c++/4.6/bits/stl_pair.h:125:2: note: template&lt;class _U2, class&gt; std::pair::pair(const _T1&amp;, _U2&amp;&amp;)
  /usr/include/c++/4.6/bits/stl_pair.h:120:2: note: template&lt;class _U1, class&gt; std::pair::pair(_U1&amp;&amp;, const _T2&amp;)
  /usr/include/c++/4.6/bits/stl_pair.h:112:17: note: constexpr std::pair&lt;_T1, _T2&gt;::pair(const std::pair&lt;_T1, _T2&gt;&amp;) [with _T1 = const int, _T2 = Process*, std::pair&lt;_T1, _T2&gt; = std::pair&lt;const int, Process*&gt;]
  /usr/include/c++/4.6/bits/stl_pair.h:112:17: note:   candidate expects 1 argument, 2 provided
  /usr/include/c++/4.6/bits/stl_pair.h:108:21: note: template&lt;class _U1, class _U2&gt; constexpr std::pair::pair(const std::pair&lt;_U1, _U2&gt;&amp;)
  /usr/include/c++/4.6/bits/stl_pair.h:103:26: note: constexpr std::pair&lt;_T1, _T2&gt;::pair(const _T1&amp;, const _T2&amp;) [with _T1 = const int, _T2 = Process*]
  /usr/include/c++/4.6/bits/stl_pair.h:103:26: note:   no known conversion for argument 2 from ‘Process’ to ‘Process* const&amp;’
  /usr/include/c++/4.6/bits/stl_pair.h:99:26: note: constexpr std::pair&lt;_T1, _T2&gt;::pair() [with _T1 = const int, _T2 = Process*]
  /usr/include/c++/4.6/bits/stl_pair.h:99:26: note:   candidate expects 0 arguments, 2 provided
  </code></pre>
  
  <p>Any ideas what could be causing these errors? I'm new to C++, so I have been working off of examples of unordered_maps I've found around the web. Any help is greatly appreciated. Please and thank you!</p>