title: Searching a set of unique pointers
body: <p>I have a set of unique pointers pointing to objects. Occasionally, I will reveal some of the raw pointers to these objects so other parts of the code can do stuff with the objects. This code does not know whether the pointers are pointing to objects maintained by a certain set of unique pointers or not, so I need to check whether the object pointed to by a pointer is in a unique pointer set.</p>
  
  <p>In simple code:</p>
  
  <pre><code>int* x = new int(42);
  std::set&lt;std::unique_ptr&lt;int&gt;&gt; numbers;
  numbers.insert(std::unique_ptr&lt;int&gt;(x));
  
  numbers.find(x) // does not compile
  </code></pre>
  
  <p>I understand why the code does not compile, but I cannot think of a way to search for the element with the STL. Is there anything that caters to my needs or will I have to iterate over all elements of the set manually?</p>