Deleting element from List of object pointers with iterator pointer (C++) : <p>I have a List of object pointers, and I'm trying to delete an element with an iterator pointer and I keep getting build errors as I'm not sure what the proper way to go about this is. Here is some of the code in question. Also, here is my error in a pastebin.</p>

<pre>

    class PlaneManager{
    private:
      list * planes = new list;
      list::iterator * iter = new list::iterator;      
    public:
        void DeletePlane(const string& tailNumber);

</pre>

<p>Here is the function in question that throws errors.</p>

<p><pre></p>

<code>void PlaneManager::DeletePlane(const string&amp; tailNumber){
  if(PlaneExists(tailNumber)){ 
    for (iter = planes-&gt;begin(); iter != planes-&gt;end();++iter){
      if(iter.GetTailNumber() == tailNumber)
        planes-&gt;erase(iter);
    }
  }else
    cout &lt;&lt; "Couldn\'t find that plane." &lt;&lt; endl;
}
</code></pre>

<p>Thanks for any insight you can provide, as I'm still a little lost with pointers.</p>
