From the code in post #1, the outer loop seems irrelevant in the context of the question asked - as the control variable isn't used?

The important code is hence:

Code:
for (auto& tddCell : nCellList.tddCellList)
                         {
                              if(condition)
                               erase(tddCell);
                          }
This is a common requirement and, as Wolle says in post #2, there are 2 ways of doing this. As erase invalidates iterator(s) (and which depends upon the type of container used), no method can be used that uses implied iterators - such as range-for does.

Given a container c of numbers, the 2 methods are basically:

Code:
// Erase all even numbers
    for (auto it = c.begin(); it != c.end(); )
        if (*it % 2 == 0)    // Condition for erasure
            it = c.erase(it);
        else
            ++it;
Note that there is no increment in the for statement. The iterator is only incremented if the erase condition is not true. If the element is erased, the return value from .erase() is the next element iterator (since C++11).

The other way is to use the Erase-Remove idiom:

Code:
c.erase(std::remove_if(c.begin(), c.end(), [](auto n){return n % 2 == 0;}), c.end());
where the lambda is the condition for removal.

The Erase-Remove is the recommended way of doing this, as .erase() is usually expensive as it may involve shuffling memory (depending upon the type of container).