title: Find a value in a set of shared_ptr
body: <p>I have a set of <code>shared_ptr</code> and would like to find a value in it:</p>
  
  <pre><code>typedef std::shared_ptr&lt;int&gt; IntPtr;
  
  struct Compare {
    bool operator() (const IntPtr&amp; a, const IntPtr&amp; b) {
      return *a &lt; *b;
    }
  };
  std::set&lt;IntPtr, Compare&gt; s;
  
  auto x = std::make_shared&lt;int&gt;(3);
  s.insert(x);
  
  bool found = s.find(std::make_shared&lt;int&gt;(3)) != s.end();
  </code></pre>
  
  <p>It's working, but not efficient - it need to new a temp pointer every time when trying to find a value.</p>
  
  <p>Is there any other way for it? </p>
  
  <p>Looks like <a href="https://stackoverflow.com/questions/15228895/searching-in-a-set-of-shared-ptrqstring">Searching in a set of shared_ptr&lt;QString&gt;</a> has some ideas that might help?</p>