title: How do delete items in a vector if using remove_if and items are pointers to objects?
body: <p>I fear that I am running into memory leak issues by doing the following:</p>
  
  <p>(Sample code)</p>
  
  <pre><code>class myItem //random container stuff mostly. All primatives.
  {
      int index;
      char* name;
      int val1;
      int val2;
  };
  
  class vecList
  {
  
      vector&lt; myitem* &gt; *myVec;
  
      void delete()
      { 
          MyVec-&gt;erase(std::remove_if(myVec-&gt;begin(), MyVec-&gt;end(), IsMarkedToDelete), MyVec-&gt;end()); //leak here?
      }
  };
  </code></pre>
  
  <p>Erase doesn't free the memory if it's a pointer, right? If I wasn't using remove_if, I could call delete on the pointer before destroying it. How would I do it in this case? Smart Pointers? I'd prefer not to re-implement everything with them and I don't really want to add the boost library.</p>
  
  <p>Thanks!</p>