title: removing item from list of weak_ptrs
body: <p>I have a list of weak_ptrs that I'm using to keep track of objects. At a certain point, I would like to remove an item from the list given a shared_ptr or a weak_ptr.</p>
  
  <pre><code>#include &lt;list&gt;
  
  int main()
  {
  typedef std::list&lt; std::weak_ptr&lt;int&gt; &gt; intList;
  
  std::shared_ptr&lt;int&gt; sp(new int(5));
  std::weak_ptr&lt;int&gt; wp(sp);
  
  intList myList;
  myList.push_back(sp);
  
  //myList.remove(sp);
  //myList.remove(wp);
  }
  </code></pre>
  
  <p>However, when I uncomment the above lines, the program won't build:</p>
  
  <pre><code>1&gt;c:\program files (x86)\microsoft visual studio 10.0\vc\include\list(1194): error C2678: binary '==' : no operator found which takes a left-hand operand of type 'std::tr1::weak_ptr&lt;_Ty&gt;' (or there is no acceptable conversion)
  </code></pre>
  
  <p>How do I remove an item from the list given a shared_ptr or a weak_ptr?</p>