title: unable to find key in unordered_map
body: <p>Created an unordered_map with key as a shared_ptr of a class. Defined a hash function that created hash based on a data member of the class. I am not able to lookup the key. I see that hash method is called during the find operation.</p>
  
  <pre><code>// key to be stored in unordered_map
  class data {
      public:
      char c;
      int i;
      data(char cc,int ii) {
         c=cc;i=ii;
      }
  };
  
  class myhash {
      public:
      size_t operator()(const std::tr1::shared_ptr&lt;data&gt; d1 ) const { 
          std::cout &lt;&lt; "&gt;" &lt;&lt;  std::tr1::hash&lt;int&gt;()(d1-&gt;c) &lt;&lt; std::endl; 
          return std::tr1::hash&lt;int&gt;()(d1-&gt;c); 
      }
  };
  
  int main() {
      std::tr1::unordered_map&lt;std::tr1::shared_ptr&lt;data&gt;, char, myhash&gt; umap;
      //build map
      std::tr1::shared_ptr&lt;data&gt; d1( new data('A',1));
      umap[d1]='C';
      std::tr1::shared_ptr&lt;data&gt; d2( new data('B',1));
      umap[d2]='C';
      std::tr1::shared_ptr&lt;data&gt; d3(new data('C',1));
      umap[d3]='F';
      std::tr1::shared_ptr&lt;data&gt; d4(new data('D',1));
      umap[d4]='E';
      std::tr1::shared_ptr&lt;data&gt; d5(new data('E',1));
      umap[d5]='F';
      std::tr1::shared_ptr&lt;data&gt; d6(new data('F',1));
      umap[d6]='F';
  
      std::cout &lt;&lt; "--------------" &lt;&lt; std::endl;
  
      for(std::tr1::unordered_map&lt;std::tr1::shared_ptr&lt;data&gt;, char,myhash&gt;::iterator itr = umap.begin(); itr!=umap.end(); itr++) {
          if(itr-&gt;first-&gt;c == itr-&gt;second) 
              continue;
          std::tr1::shared_ptr&lt;data&gt; d11( new data(itr-&gt;second,0));
          std::tr1::unordered_map&lt;std::tr1::shared_ptr&lt;data&gt;, char,myhash&gt;::iterator index = umap.find(d11);
          if(index != umap.end()) &lt;&lt;&lt;&lt;----- its always null here. Not sure why
              index-&gt;first-&gt;i += itr-&gt;first-&gt;i;
          else
              std::cout &lt;&lt; "NULL" &lt;&lt; std::endl;
      }
  
      for(std::tr1::unordered_map&lt;std::tr1::shared_ptr&lt;data&gt;, char,myhash&gt;::iterator itr = umap.begin(); itr!=umap.end(); itr++) 
          std::cout &lt;&lt; itr-&gt;first-&gt;c &lt;&lt; " " &lt;&lt; itr-&gt;first-&gt;i &lt;&lt; std::endl;
  }
  </code></pre>