Correct Iteration with deletion in List syntax
<p>I'm currently writing a program that uses lists at a point in said program i want to iterate through 3 three lists a, b and c, and delete any element in b and c if it appears in a. Im doing it as such:</p>

<pre><code>//remove elements from OpenList that are in ClosedList
    for(list&lt;Node&gt; :: iterator cloIt = ClosedList.begin(); cloIt != ClosedList.end(); cloIt++)
    {
        for(list&lt;Node&gt; :: iterator opIt = OpenList.begin(); opIt != OpenList.end(); opIt++)
        {
            for(list&lt;Node&gt; :: iterator neigIt = Neighbour.begin(); neigIt != Neighbour.end(); neigIt++)
            {
                if (*cloIt == *opIt)
                {
                    opIt = OpenList.erase(opIt);

                }
                if (*cloIt == *neigIt)
                {
                    neigIt = Neighbour.erase(neigIt);
                }
            }
        }
    }
</code></pre>

<p>However this is causing me to get an "List iterator not incrementable" error
How could i fix this?</p>
