title: 'No matching function for call' error when inserting class into a STL map
body: <p>I have a STL map in C++ where the key is an unsigned int, and the value is a class whose constructor is:</p>
  
  <pre><code>Foo::Foo(unsigned int integerValue){
      //Some stuff
  }
  </code></pre>
  
  <p>At other class I have declarated the std::map at the header:</p>
  
  <pre><code>private:
      std::map&lt;unsigned int, Foo&gt; *m_mapFoo;
  </code></pre>
  
  <p>And at the cpp file I created it and inserted instances of Foo:</p>
  
  <pre><code>m_mapFoo = new std::map&lt;unsigned int, Foo&gt;;
  m_mapFoo-&gt;insert(0, new Foo(0));
  m_mapFoo-&gt;insert(1, new Foo(1));
  </code></pre>
  
  <p>But I'm getting the following error at the insert methods:</p>
  
  <pre><code>no matching function for call to ‘std::map&lt;unsigned int, Foo, std::less&lt;unsigned int&gt;, std::allocator&lt;std::pair&lt;const unsigned int, Foo&gt; &gt; &gt;::insert(const unsigned int&amp;, Foo*)’
  </code></pre>
  
  <p>Similar problem at find method:</p>
  
  <pre><code>m_mapFoo.find(0)-&gt;second-&gt;someFunctionIntoFooClass();
  </code></pre>
  
  <p>Where the error is exactly the following:</p>
  
  <pre><code>request for member ‘find’ in ‘((Foo*)this)-&gt;Foo::m_mapGeoDataProcess’, which is of non-class type ‘std::map&lt;unsigned int, Foo, std::less&lt;unsigned int&gt;, std::allocator&lt;std::pair&lt;const unsigned int, Foo&gt; &gt; &gt;*’
  </code></pre>
  
  <p>Additional notes: I don't have a Foo copy constructor, but I don't think that's the problem.</p>
  
  <p>Any help understanding this errors?</p>