title: remove_if from a std::vector of shared pointers with a member function
body: <p>How can I delete the elements of a <code>std::vector&lt;std::shared_ptr&lt;PTile&gt;&gt; ptiles</code> fullfilling the condition <code>ptile-&gt;hasNoRegions()</code>? I've been trying to use <code>remove_if</code> for this, but the <code>Predicate</code> uses a data member of the object, not the pointer. How do I set the predicate to the function if the elements are smart pointers to the object?</p>
  
  <p>What I have at the moment</p>
  
  <pre><code>    ptiles.erase(std::remove_if(ptiles.begin(), ptiles.end(), &amp;PTile::hasNoRegions), ptiles.end());
  </code></pre>
  
  <p>where <code>hasNoRegions</code> is a member function of <code>PTile</code>. Which obviously doesn't work since I have a <code>std::shared_ptr&lt;PTile&gt;</code>, not a <code>PTile</code>.</p>
  
  <p>I'm using MSVC 2013.</p>